I'm trying to copy cells in a row but every row will have varying lengths. Eg: Row1 has data from A1:H1 Row2 has data from A2:L2 Row3 has data from A3:D3 The usual code would be .Range(.Cells(i,"A"),.Cells(i,"H")).Copy But in a loop how do I make this detect the length of the row??
Thanks!
lastCol = Cells(5,Columns.Count).End(XlToLeft).Column, which gives you the last column. Then, it's justmyRowRange = Range(Cells(5,1),Cells(5,lastCol)). - BruceWayne