columns identification

  • Thread starter Thread starter LearningVBA
  • Start date Start date
L

LearningVBA

Hello, I am using [lastColumn = Range("BB1").End(xlToLeft).Column] to find
out where is the last column, it will return an integer. I can not use this
integer in the following: [Columns("A:" & lastColumn).NumberFormat = "@" for
example. I have to hard code the equivalent like [Columns("A:" &
lastColumnStr).NumberFormat ...]. This is not practical if the report is
dropping or adding a column. Is there a way to solve this if I want to use
the following construct: [Columns("A:" & lastColumn).NumberFormat ....]?

Thank you for your input
 
Columns("A").Resize(, lastColumn).NumberFormat ...

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 

Ask a Question

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.

Ask a Question

Similar Threads


Back
Top