nathan2314
10-29-2010, 02:27 PM
Hi
How can I find the last empty column in a row. I need to find the last row and also the last column in that row so I can paste data all in one row. In the code below, it works for finding the last row, but the column part doesn't work. It gives an error. I tried using End(xlleft) and .End(xlRight) but those give an error that says "400". .End(xlup) and .End(xldown) work fine.
Appreciate any help!
endrow_d = basebook.Sheets("raw data").Cells(65536, 1).End(xlUp).Row + 1
endcol_d = basebook.Sheets("raw data").Cells(endrow_d, 100).End(xlLeft)
How can I find the last empty column in a row. I need to find the last row and also the last column in that row so I can paste data all in one row. In the code below, it works for finding the last row, but the column part doesn't work. It gives an error. I tried using End(xlleft) and .End(xlRight) but those give an error that says "400". .End(xlup) and .End(xldown) work fine.
Appreciate any help!
endrow_d = basebook.Sheets("raw data").Cells(65536, 1).End(xlUp).Row + 1
endcol_d = basebook.Sheets("raw data").Cells(endrow_d, 100).End(xlLeft)