dragos
04-02-2012, 04:13 AM
Dear experts,
I have the code below:
Dim r As Range
Dim i As Integer
i = 15
Set r = wb.Sheets("List of Products").Range("B7:B100")
For Each cell In r
If Not IsEmpty(cell) Then
' I update the current document with data from wb document
.Range(E1 & i).Formula = wb.Worksheets("List of Products").Range("B7").Value
Cancel = True
End If
As you can see I am trying to increment the cell number:
Range(E & i) should be i.e. Range(E15)
I tryed using Range(cell) but did not worked.
In any other language I would of done:E(counter++)
How can I use this counter in VBA ?
Regards,
Dragos
I have the code below:
Dim r As Range
Dim i As Integer
i = 15
Set r = wb.Sheets("List of Products").Range("B7:B100")
For Each cell In r
If Not IsEmpty(cell) Then
' I update the current document with data from wb document
.Range(E1 & i).Formula = wb.Worksheets("List of Products").Range("B7").Value
Cancel = True
End If
As you can see I am trying to increment the cell number:
Range(E & i) should be i.e. Range(E15)
I tryed using Range(cell) but did not worked.
In any other language I would of done:E(counter++)
How can I use this counter in VBA ?
Regards,
Dragos