View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Range as variable

Steph,

Dim Var3 As Range
Dim i As Integer

Set Var3 = Range(Cells(ActiveCell.Row, "D"), _
Cells(ActiveCell.Row, "D").End(xlToRight))

For i = 1 To Var3.Cells.Count
MsgBox Var3(i).Value
Next i

HTH,
Bernie
MS Excel MVP


"Steph" wrote in message
...
Hi. I have a variable defined as below:
var3 = Cells(ActiveCell.Row, "D").Value

How can I convert var3 to be (in laymans terms) ActiveCell.Row, "D"

through
BB xlleft

So if active row is 3, var 3 might be D3:G3, if G was the last data point
and H and to the right was blank.

Thanks!