blackorchids2002
Board Regular
- Joined
- Dec 29, 2011
- Messages
- 138
Hi Everyone,
I need your expertise again. Below is only part of the code I'm trying to generate.
What I'm trying to achieve is how to loop the ALoc1, ALoc2 etc. to assign the value fromCells(5 + i, 5) in the PPSheet.
In default, ALoc1 is equal to SchedA.Range("B6")
and I wanted to change the value from the PPSheet. I wanted to change the number ALoc1 as I loop it.
Sub testprice()
Set SchedA = Sheets("Schedule A")
Set PPSheet = Sheets("Project Pricing Summary")
For i = 1 To 10
'Declaration of Avaya H&S no. Location or Service Type in the PP Summary sheet
ALoc1 = SchedA.Range("B6")
ALoc2 = SchedA.Range("B13")
ALoc3 = SchedA.Range("B20")
ALoc4 = SchedA.Range("B27")
ALoc5 = SchedA.Range("B34")
ALoc6 = SchedA.Range("B41")
ALoc7 = SchedA.Range("B48")
ALoc8 = SchedA.Range("B55")
ALoc9 = SchedA.Range("B62")
ALoc10 = SchedA.Range("B69")
If PPSheet.Cells(5 + i, 5) <> "" Then
PPSheet.Select
Cells(5 + i, 5).Select
ALoc1 = Cells(5 + i, 5)
End If
Next i
End Sub
Thanks,
blackorchids
I need your expertise again. Below is only part of the code I'm trying to generate.
What I'm trying to achieve is how to loop the ALoc1, ALoc2 etc. to assign the value fromCells(5 + i, 5) in the PPSheet.
In default, ALoc1 is equal to SchedA.Range("B6")
and I wanted to change the value from the PPSheet. I wanted to change the number ALoc1 as I loop it.
Sub testprice()
Set SchedA = Sheets("Schedule A")
Set PPSheet = Sheets("Project Pricing Summary")
For i = 1 To 10
'Declaration of Avaya H&S no. Location or Service Type in the PP Summary sheet
ALoc1 = SchedA.Range("B6")
ALoc2 = SchedA.Range("B13")
ALoc3 = SchedA.Range("B20")
ALoc4 = SchedA.Range("B27")
ALoc5 = SchedA.Range("B34")
ALoc6 = SchedA.Range("B41")
ALoc7 = SchedA.Range("B48")
ALoc8 = SchedA.Range("B55")
ALoc9 = SchedA.Range("B62")
ALoc10 = SchedA.Range("B69")
If PPSheet.Cells(5 + i, 5) <> "" Then
PPSheet.Select
Cells(5 + i, 5).Select
ALoc1 = Cells(5 + i, 5)
End If
Next i
End Sub
Thanks,
blackorchids