PDA

View Full Version : [SOLVED] Problem with Range Box



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

Philcjr
07-23-2005, 06:44 AM
comment this line of code... see if this helps



'Application.ScreenUpdating = False



This will allow you to select a range

Bob Phillips
07-23-2005, 07:12 AM
comment this line of code... see if this helps


'Application.ScreenUpdating = False

This will allow you to select a range

Don't do that, just re-order



Set rng = Application.InputBox("Select Range", Type:=8)
Application.ScreenUpdating = False

Dreamer
07-23-2005, 07:31 AM
THANK YOU!:)