How do i express this in number

  • Thread starter Thread starter Phil Hunt
  • Start date Start date
P

Phil Hunt

What is an equilvalent expression in Range("A1") using only number inside
the prarentheses, how about Range("2:3")

I am trying to loop thru cells in a range, but working with qoutes make it
little bit harder.

thanks.
 
Hi

Cells(rownumber, columnnumber)
like this:

Sub LoopEm()
Dim R As Long, C As Long
For R = 3 To 5
For C = 2 To 3
MsgBox Cells(R, C).Address
Next
Next
End Sub
 
Thanks for fast reply, but I am actually look for an equivalent expression
only. What would Range("A1") or Range("2:3") be using only numbers inside
the ().
 
I don't quite follow you. But you want to loop all cells in a known range. Select a few
cells and see if this is what you're after:

Sub Loop2()
Dim L As Long
Dim R As Range
Set R = Selection

For L = 1 To R.Count
MsgBox R(L).Address
Next
End Sub
 
ok, i'll be specific.
i need to do the following:

while ...
Range("E3").EntireColumn.Insert
.. fill up Range("F3") with some data
Range("G3").EntireColumn.Insert
... fill up Range("H3") with some data
wend


So working with qoute is little harder,(i mean how can u get from E to F),
can you help me with this. the RANGE, CELL, SELECTION object is a little
confusing to me.
 
I'd do that one like this:

Sub test()
Dim L As Long
For L = 5 To 17 Step 2
Columns(L).Insert
Cells(3, L + 1).Value = Time 'or whatever
Next
End Sub
 
Slick. Does the trick. Do u know why .Insert does not show up on
intelisense(?), the down down method?
 
Slick. Does the trick. Do u know why .Insert does not show up on
intelisense(?), the down down method?

No idea. When I (Excel XP) enter
columns(1).
nothing pops up in intellisense at all. A good start is to record a macro while doing it
manually, like

Sub Macro1()
' Macro1 Macro
' Macro recorded 31.01.2004 by Harald Staff
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
End Sub

and from there shorten it as much as possible -until it don't work -and then one step back
so it works again:

Sub Macro1()
Columns("D:D").Insert
End Sub

Thanks for the feedback.

Best wishes Harald
Followup to newsgroup only please.
 
Back
Top