Hi,
my loop is not working and i can't figure out why?
Also how do i get the macro to find cells that begin with that number and do not equal it?
Thanks,
Sub NomCalc()
Dim i As Integer
Dim ws1 As Worksheet
Dim c As Integer
Dim GVal As Long
Set ws1 = Sheets("Sheet1")
GVal = Sheets("P & L Major Headings").Range("B8").Value
c = 23 ' Period 1
If Sheets("P & L Major Headings").Range("B4") > 1.01 Then
c = c + Sheets("P & L Major Headings").Range("B4") - 1
Else
End If
For i = 3 To 5000
If ws1.Cells(i, A) = "0124" Then 'can this search for cells that begin with this number?
GVal = Sheets("P & L Major Headings").Range("B8").Value
GVal = GVal + Cells(c, i).Value
Else
Exit Sub
End If
Next i
Sheets("P & L Major Headings").Range("B8").Value = GVal
End Sub
Bookmarks