Forum Discussion
Excel
Jul 12, 2022Iron Contributor
Query Related to Hiding sheet and change currency with the help of VBA code.
Hello Everyone, I have a 2 questions : 1st question --- What VBA code should i write to change Euro to USD currency? 2nd question --- Whenever i hide the sheet like - th...
ecovonrein
Jul 13, 2022Iron Contributor
The FOR EACH assigns a Worksheet object to ws, so you should be able to simply write ws.Select, I think.
Excel
Jul 13, 2022Iron Contributor
From where should i write ?
Please help..
Please help..
- HansVogelaarJul 13, 2022MVP
Sub LoopYearlyReport() Dim ws As Worksheet Dim FirstTime As Boolean FirstTime = True For Each ws In Worksheets If ws.Visible = xlSheetVisible And ws.Name <> "YEARLY REPORT" Then ws.Select If Range("A1").Value <> "Division" Then InsertHeaders FormatHeaders End If AutomateTotalSUM ' SELECT CURRENT DATA Range("A2").Select Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlToRight)).Select ' COPY DATA Selection.Copy ' SELECT "YEARY REPORT" Worksheets("YEARLY REPORT").Select ' PASTE DATA Range("A30000").End(xlUp).Select If FirstTime <> True Then ActiveCell.Offset(1, 0).Select Else FirstTime = False End If ActiveSheet.Paste End If ' MOVE TO THE THE NEXT SHEET IN THE LOOP Next ws Worksheets("Yearly Report").Select If Range("A1").Value <> "Division" Then InsertHeaders FormatHeaders End If AutomateTotalSUM Application.CutCopyMode = False End Sub