Hi Guys,
I am completely new to vba and was wondering if anyone could explain why this wont run for me?:
Option Explicit
Sub ReNumber()
Dim ws As Worksheet
Dim stepCounter, manualStepNum, currentStepNum
stepCounter , currentStepNum = 1
Set ws = Workbooks("blah.xls")
For Each ws In Worksheets
Do Until (Range("A" & stepCounter).Text = "")
If Left(Range("A" & stepCounter).Text, 4) = "Test" Then
manualStepNum = Right(Range("A" & stepCounter).Text, 1)
currentStepNum = 1
End If
If Left(Range("A" & stepCounter).Text, 4) = "Step" Then
Range("A" & stepCounter).Value = "Step " & manualStepNum & "." & currentStepNum
currentStepNum = currentStepNum + 1
End If
stepCounter = stepCounter + 1
Next
End Sub
Whenever I try to run this I get a compile error which says that It was expecting a Sub, Function or Property and then highlights the "Sub" line
Bookmarks