Dreamer
07-23-2005, 06:38 AM
Hi,
What's wrong with following codes?
The inputbox doesn't allow me to highlight any cells on the spreadsheet,
so I have to type in the range e.g. C6:C10 myself..
Please advise, thanks.
Sub Delete_PrefixCharacters()
Dim wsActive As Worksheet
Dim rng As Range
Dim R As Range
Application.ScreenUpdating = False
Set rng = Application.InputBox("Select Range", Type:=8)
Set wsActive = ActiveSheet
With wsActive
' Loop through all used cells in the active worksheet.
For Each R In rng
' If a prefix character exists, delete it.
If R.PrefixCharacter <> "" Then
R.Value = R.Value
End If
Next
End With
Application.ScreenUpdating = True
End Sub
What's wrong with following codes?
The inputbox doesn't allow me to highlight any cells on the spreadsheet,
so I have to type in the range e.g. C6:C10 myself..
Please advise, thanks.
Sub Delete_PrefixCharacters()
Dim wsActive As Worksheet
Dim rng As Range
Dim R As Range
Application.ScreenUpdating = False
Set rng = Application.InputBox("Select Range", Type:=8)
Set wsActive = ActiveSheet
With wsActive
' Loop through all used cells in the active worksheet.
For Each R In rng
' If a prefix character exists, delete it.
If R.PrefixCharacter <> "" Then
R.Value = R.Value
End If
Next
End With
Application.ScreenUpdating = True
End Sub