Hi to all
I have this code courtesy of NimRod
Sub ReplaceIt()
On Error GoTo Xit
With Cells
Set C = .Find("-", LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
Do
C.NumberFormat = "@"
C.Value = Replace(C.Value, "-", "")
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
End With
Xit:
End Sub
I have set in module and I can run it from the open sheet as a macro to be applied to any sheet that I have open.
What I would like to know is how I can set it up to run from a button that I have in an sheet that is not build from the VB.
Thank you
John
I have this code courtesy of NimRod
Sub ReplaceIt()
On Error GoTo Xit
With Cells
Set C = .Find("-", LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
Do
C.NumberFormat = "@"
C.Value = Replace(C.Value, "-", "")
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
End With
Xit:
End Sub
I have set in module and I can run it from the open sheet as a macro to be applied to any sheet that I have open.
What I would like to know is how I can set it up to run from a button that I have in an sheet that is not build from the VB.
Thank you
John