Quick Question –
In access, I can activate an excel application and determine the number of columns being used in the excel sheet using the formula:
xlsht.range(“IV2).END(xlToLeft).Column. (Thanks Hans)
This works and returns an integer, i.e., 25 for the number of columns.
However, in excel, this correlates to Column Y. Is there an easy way to convert the integer column number returned to the excel string representing the column number? (Anyone have a handy dandy function out there)
I can also go to the last active cell and get its address returned as say $Y$43 but am looking for an easier solution as I will need to go to the last active cell, check to see if its value is zero, and if so, delete the column. Then loop through each prior columns last active cell until there are no longer any zeroes.
—-
To make this clearer
– Open an excel worksheet
– dim lac as variant ‘Last Active Cell
– Go to last active cell and set lac = value
– if lac = zero then
— do while lac = zero
— delete column
— go to last active cell in prior column
— lac = value of current active cell
– -loop
end if
–