I am working with a column of data in which the range (e.g. how many rows of data there'll be) will eventually vary for each new sheet that a user creates.
On one sheet, the range in B may be from B3:B7, on another, it may be from B3:B22 for example.
I want a Macro that copies the data from the range B3:Bn, with n being the last row before there is a blank cell in the next row. For example, Copy B4:B7, and in B8 there is a blank cell. I want to paste this range into another workbook, in column C.
I'm only a beginner in VBA and have not gotten far with the code. I have tried several iterations of a loop but it doesn't really work.
This is the weak code i have so far. Any help is appreciated.
Sub main()
Dim r As Range
Set r = Range("B3")
Do While r.Value <> ""
Range("C").Value = r.Value
Set r = r.Offset(1)
Loop
End Sub