In the following code I am locating a cell with a specific date and then I want to move down 1 row and 3 columns to the left.
Next I want to obtain a range starting at this new cell location, for 3 columns and down x number of rows.
How do I obtain the range from column a:c and all rows below that are not empty?
Here's the code:
Cells.Find(What:=fdate(ctr), After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
If mmdd = "0101" Or mmdd = "0701" Then
ActiveCell.Offset(1, -3).Select
Else
ActiveCell.Offset(1, 0).Select
End If
ActiveSheet.Paste
once the number of columns has been selected, I'm assuming by a range statement I would issue the following to get the
number of rows.
Range(Selection, Selection.End(xlDown)).Select
I hope this makes sense to someone out there. I'm somewhat new to VB and the books I'm using don't offer much help, or I'm just not seeing it.
Thanks in advance,
Larry B.
MS Sql Server LazyDBA home page