To do ALL worksheets with no regard for filtering:
Option Explicit
Sub ChangeByPercentage()
Dim Perc As Long
Dim ws As Worksheet
Perc = Application.InputBox("Multiple by what percentange? (105 would increase by 5%)", _
"Multiplication factor", 105, Type:=1)
If Perc = 0 Then Exit Sub
For Each ws In Worksheets
ws.Range("G12").Value = ws.Range("G12").Value * Perc
Next ws
End Sub
If you only want this to occur on specific sheets, list them specifically this way:
Option Explicit
Sub ChangeByPercentage()
Dim Perc As Long
Dim ws As Worksheet
Perc = Application.InputBox("Multiple by what percentange? (105 would increase by 5%)", _
"Multiplication factor", 105, Type:=1)
If Perc = 0 Then Exit Sub
For Each ws In Sheets(Array("Sheet1", "Sheet3", "Sheet5"))
ws.Range("G12").Value = ws.Range("G12").Value * Perc
Next ws
End Sub
If you want this to run on all sheets EXCEPT one sheet, then exclude that sheet by naming it specifically:
Option Explicit
Sub ChangeByPercentage()
Dim Perc As Long
Dim ws As Worksheet
Perc = Application.InputBox("Multiple by what percentange? (105 would increase by 5%)", _
"Multiplication factor", 105, Type:=1)
If Perc = 0 Then Exit Sub
For Each ws In Worksheets
If ws.Name <> "Summary" Then ws.Range("G12").Value = ws.Range("G12").Value * Perc
Next ws
End Sub
Bookmarks