I have no idea how to convert it to a flowchart. I tried looking it up with no such luck. Below is a sample of the code that I need to convert to a flowchart. Thank you!
Code:
Public Sub mainSub()
'Dim path As String
'Workbooks("try3.xlsm").Activate
'path = ActiveWorkbook.path
'ChDir path
'Set NewBook = Workbooks.Add
'Workbooks.Add
'ActiveWorkbook.SaveAs Filename:="output111" & ".xls"
CreateWorkBookAndAddSheets (3)
CreateWorkBookAndAddSheets (4)
'NewBook.Close SaveChanges:=True
MsgBox "Done!"
End Sub
Private Sub CreateWorkBookAndAddSheets(ByVal repeatingNum As Integer)
Dim rowCount As Long
Dim sourceDataSheet As Worksheet
Set sourceDataSheet = ActiveWorkbook.Sheets("data")
rowCount = sourceDataSheet.Range("A" & Rows.Count).End(xlUp).Row
Dim resultSheet As Worksheet
Set resultSheet = ActiveWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
resultSheet.Name = "Data for All repeating " & repeatingNum
Dim i As Long
Dim j As Long
Dim k As Long
Dim first As Boolean
k = -1
j = 0
first = True
For i = 1 To rowCount
If sourceDataSheet.Range("A1").Offset(i, 0).Value = repeatingNum And (repeatingNum = 3 Or repeatingNum = 4) Then
If first = True Then
k = k + 1
j = 0
first = False
End If
resultSheet.Range("A1").Offset(j, k).Value = sourceDataSheet.Range("B1").Offset(i, 0).Value
j = j + 1
Else
first = True
End If
Next i
End Sub