Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
(1) s after next is redundant, and (2) you can't select a range if the sheet
that the range is on isn't active, but in this case, it doesn't need to be. Here's the amended code for you: For s = 2 To ActiveWorkbook.Sheets.Count If Sheets(s).Range("A50").Value = 3 Then Sheets(s).Range("A4:A19").NumberFormat = "0.00%" End If Next "Fan924" wrote in message ... I am looping through sheets "s" 2 to 20 For s = 2 To ActiveWorkbook.Sheets.Count If Sheets(s).Range("A50").Value = 3 Then Sheets(s).Range("A4:A19").Select Selection.NumberFormat = "0.00%" End If Next s This works fine ... Sheets(s).Range("A50").Value Sheets(s).Range("A4:A19").Select.... When I change .Select to.Value , I get an error. What can I use as an alternate? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Select method of Range class failed" Error | Excel Discussion (Misc queries) | |||
"run-time error '1004' - select method of range failed" | Excel Programming | |||
VBA error 1004 "Select method of Range class failed" | Excel Programming | |||
Error 1004, "select method of range class failed" | Excel Programming | |||
Runtime Error "1004" Select Method of Range Class Failed | Excel Programming |