Thanks acw!
I ran your code and it works till the last selected cell (I did a small test by selcting only 2 cells). Once that cell is formatted etc. it fails on the 'Next...' command with error 92 - For loop not initialized.
I am including my code below (with comments and queries). Appreciate if obvious errors can be corrected with helpful comments.
Code:
Dim rCell As Range
Dim rRange As Range
Dim iChoice As Integer
If Selection.Cells.Count = 1 Then
MsgBox "Please select the range to convert", vbInformation
Exit Sub
End If
On Error Resume Next
' I am working on Auto-filtered data. Hence I need my range to consist of
'visible cells in my selection.
Set rRange = Selection.SpecialCells(xlCellTypeVisible)
For Each rCell In rRange '(Cells(1, ActiveCell.Column), Cells(Rows.Count, ActiveCell.Column).End(xlUp)) ... Have modified your formula here to suit
If rCell.NumberFormat = "0.00%" Then
rCell.NumberFormat = "general"
rCell.Value = rCell.Value * 100
End If
Next rCell
' I now need to color rRange cells RED
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
'QUERY: I need to colour RED corresponding cells 4 columns to right. Is following code OK?
Set rRange = rRange.Offset(, 4).SpecialCells(xlCellTypeVisible).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
iChoice = MsgBox("Wish to copy Fee Type & P Chg Criteria?", vbYesNo)
If iChoice = vbYes Then
MsgBox "Please select cells to copy"
' QUERY: I now need to manually select 2 adjacent cells from different columns after the msgbox and then copy them. I think something is missing
' between OK on msgbox to the next code line i.e how will the macro allow me to select and then remember the selection? Please help.
Selection.Copy
On Error Resume Next 'QUERY:Is this error capture step OK. Quite confused on which steps to include error lines?
MsgBox "Please select destination range" 'QUERY: same problem as above.
Set rRange = Selection.SpecialCells(xlCellTypeVisible)
ActiveSheet.Paste
Application.CutCopyMode = False
Else
Exit Sub 'This for vbNo choice.
End If
On Error GoTo 0 'QUERY:Confused if this line is OK here?
End Sub
Thanks again for your assistance.

Originally Posted by
acw
Hi
How about
Code:
Sub ddd()
For Each ce In Range(Cells(1, ActiveCell.Column), Cells(Rows.Count, ActiveCell.Column).End(xlUp))
If ce.NumberFormat = "0.00%" Then
ce.NumberFormat = general
ce.Value = ce.Value * 100
End If
Next ce
End Sub
This runs based on the currently selected cell. No testing is done for multiple cell selections etc.
HTH
Tony
Bookmarks