View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
LarryP LarryP is offline
external usenet poster
 
Posts: 73
Default String with Cell Reference

You can stand down, Bernie; the .ADDRESS reference you provided works fine,
got rid of the array and several string variables.

"Bernie Deitrick" wrote:

Larry,

Let's say that you have a ColumnCount variable

Sub TryNow()
Dim ColumnCount As Integer
Dim i As Integer

ColumnCount = 2

For i = 1 To ColumnCount
MsgBox Cells(1, i).Address(False, False)
Next i
End Sub


But there isn't any reason I can think of that would reguire a cell address in your code.... post
your code for further assistance ....

HTH,
Bernie
MS Excel MVP


"LarryP" wrote in message
...
I have a procedure that has to deal with a sequence of columns that grows
from week to week; i.e., this week I'm working with columns A thru AJ, next
week it'll be A thru AK. At one point in the code I need a string
representation of the first cell in each column, e.g., "A1", "B1", etc. I
dealt with that initially by hardcoding an array to hold all the strings, but
I'm sure there must be a property I can iterate through to get the first-cell
references for whatever column I'm dealing with -- on the first pass give me
"A1", on the second give me "B1", etc. Can someone please help me with that
property name and/or bit of code?