Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Revised Excel VB question

Status
Not open for further replies.

Rexxx

MIS
Oct 16, 2001
47
I have the following Excel VB script:

ActiveSheet.Cells(8,14).Formula = "=$C$2"

What I would like to do is the following:

Dim i As Integer
i=2
Do
i=i+1
ActiveSheet.Cells(8,14).Formula = "=$C$i"
Loop until i >100

But Formula does not read i as an integer. What other way can this be written?
 
Have u got 2 user names?
Anyway,

"$C$i" should read "$C$" & i

Nick
 
You can do like this:

Dim i As Integer
for i=2 to 100
ActiveSheet.Cells(8,14).Formula = "=$C$" & i
next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top