Sabtu, 04 April 2015

[ExcelVBA] Re: Simple loop help

 

Something odd here. When I run it as "Dim CurrentCell As Long", it works fine, but when I change it to "Dim CurrentCell As Range", I get the error


Run-time error 91

Object variable or With block variable not set.


Also, I am trying to concatenate two cells, but retain their formats. I use:


For i = 1 To 52

      Cells(i, 4).Value = Cells(i, 2).Value & Cells(i, 3).Value
Next i


Cell (i,2) format is ok as is, but cell((i,3) font color is red. I would like to retain both formats after the concatenate. Any thoughts?

__._,_.___

Posted by: jeff.flanagan@duffcorp.ca
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------

.

__,_._,___

Tidak ada komentar:

Posting Komentar