I have trouble with this macro - help

  • Thread starter Thread starter Graham
  • Start date Start date
G

Graham

I don't know how to do this hope you guys can help.


My data starts in cell G9 to G17 going down and sometimes can be different
in length, there is always data in cell H18, on this occasion.

If my data was in G9 to G20 the other data would by in H21.

I've been trying to do a macro to get the data from that cell, to cells C9
to C17.

Thanks in advance
 
I've been trying to do a macro to get the data from that cell, to cells C9

Assuming there's nothing below the G9:G? data, try

Range("G9").Select
Range(Selection, Selection.End(xlDown)).Offset(0, -4).Value = _
Range("G65536").End(xlUp).Offset(1, 1).Value

HTH,
Andy
 
Assuming there's nothing below the G9:G? data ...

At the same time I guess there's a possibility, however slight, that the
G9:G? range might actually be G9:G9. In which case,

If Range("G10") = "" Then
Range("C9") = Range("H10")
Else
Range("G9").Select
Range(Selection, Selection.End(xlDown)).Offset(0, -4).Value = _
Range("G65536").End(xlUp).Offset(1, 1).Value
End If
 
Back
Top