G
guest
is there a way to find last column that has data in a given worksheet??
without selecting the range of data.
without selecting the range of data.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Rick Rothstein (MVP - VB) said:Not reliably. Try this... put some data in some of the rows out to Column 5
on a sheet and then put something in J3. Go to the Immediate window and
enter this...
? ActiveCell.SpecialCells(xlLastCell).Column
It should print out 10. Now issue this command in the Immediate window
Range("J3").Delete
That will remove the entry from J3 that you just put in it. Look at the
worksheet... the last used column is now 5. Go back and execute this line
again...
? ActiveCell.SpecialCells(xlLastCell).Column
It should still print out 10.
Rick
is there a way to find last column that has data in a given worksheet??
without selecting the range of data.
UsedRange.Columns.CountActiveWorksheet.UsedRange.Rows.Count

Thanks! I will fix my macros for this!statement and see what you get.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.