Hi guys. I'm stumped again. I'm working with this bit of code I found that basically detects the last row and column of a table and defines the whole area as a range. What I want to do is modify it so it detects the last row, but uses a pre-defined column instead of going to the last column. In short what I'm trying to do is copy two formulas from cells C2 and D2 down to the last row of data. Note, there is data on both sides of C and D.
Application.ScreenUpdating = False
Dim myLastRow3 As Long
Dim myLastColumn3 As Long
Range("A1").Select
On Error Resume Next
myLastRow3 = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
myLastColumn3 = Cells.Find("*", [A1], , , xlByColumns, xlPrevious).Column
myLastCell3 = Cells(myLastRow3, myLastColumn3).Address
myrange3 = "c2:" & myLastCell3
Application.ScreenUpdating = True
Range(myrange3).Select
I tried substituting the column letter in place of "mylastcolumn" but I'm guessing I'm using the wrong syntax.
Can anyone offer some advice?
Bookmarks