LastColumn used as letter(s) in VBA

  • Thread starter Thread starter GALLAGHE
  • Start date Start date
G

GALLAGHE

I have the following code to determine the last column used which returns a
numeric. Is there a method to translate this alpha using VBA e.g. 33 = "AG"

LastColumn =
ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column

Thanks for any assistance,
Kevin
 
I should have realized the "_" but don't typically break code on more then
one line beings all developers have 21" dual monitors. Concerning the need
to convert the numeric to a letter, not something I ever needed before but
it's for working with a type library in another programming language.
 
I'm not a frequent excell/VBA user, but can't you just do this with on
hit with a couple of splits?:

Split(Split(ActiveSheet.UsedRange.Columns.Address, ":")(1), "$")(1
 
Are you talking last column for a particular row.

or are all your rows of equal length.

Or are they of unequal length and you need to find the last actual column
that contains a value.

The suggestion was made to use UsedRange, but the purpose of UsedRange is to
reveal the extent of the cells for which Excel is storing detailed
information and has nothing to do whether the cells actually contain data or
not (although it will at least include those).

Perhaps a clarification of what you want will reveal a good answer.
 
Back
Top