earthworm
Well-known Member
- Joined
- May 19, 2009
- Messages
- 759
- Office Version
- 2019
- 2016
- Platform
- Windows
Dear All,
I need a macro that will create a new workbook if the value of cell B2 >0 and then i will input some another macro to perform some condition's tweaking in another sheet and then and save it on desktop with the name present in cell A2 and so on . The macro will continue loop till B50 . This means if for each cell between B2:B50 if there is any value in each cell >0 then new run another macro and save it and move to next macro
Please assist.
I tired to play with below macro by making changes but its not working
I need a macro that will create a new workbook if the value of cell B2 >0 and then i will input some another macro to perform some condition's tweaking in another sheet and then and save it on desktop with the name present in cell A2 and so on . The macro will continue loop till B50 . This means if for each cell between B2:B50 if there is any value in each cell >0 then new run another macro and save it and move to next macro
Please assist.
I tired to play with below macro by making changes but its not working
VBA Code:
Sub df()
Dim i As Integer
Dim ii As Integer
Dim ws As Worksheet
Dim str As String
i = Application.WorksheetFunction.Count(Range("B:B"))
For i = 1 To Application.WorksheetFunction.Count(Range("B:B"))
ii = Sheets.Count
str = Range("B" & i).Value
If Range("B" & i).Value > 0 Then
ThisWorkbook.Sheets.Add(after:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)).Name = str
End If
Sheets(1).Select
Next i
End Sub