Object required error in vba

I am trying to run the below macro to enter text in multiple selected sheets. But i get the runtime error "424" Object required

Sub CL_Numbering()
Dim shts As Worksheet
i = 1
For Each shts In ActiveWindow.SelectedSheets shts.Range("M3").Value = "EDRC-E-EM-FT-" & worsheetfunction.Text(i, "00") & " R0" i = i + 1
Next shts
End Sub
2

1 Answer

modify to this:

Sub CL_Numbering()
Dim shts As Worksheet
dim i as long
i = 1
For Each shts In ActiveWindow.SelectedSheets shts.Range("M3").Value = "EDRC-E-EM-FT-" & Application.WorksheetFunction.Text(i, "00") & " R0" i = i + 1
Next shts
End Sub
3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like