Hi, can someone please help….
I would like to create code that take data from one place and pastes it into a cell then sheet 1 is created in a workbook, then move to next row copy and paste data and sheet 2 is created, it will loop through the list and if there is a number there then sheet 2 is created again and added to the new workbook, then before moving to a new column it closes the new workbook and the process is started again.
Here is the code I have so far to help with the looping
Sub Pull()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim lc As Long, lr As Long, MyCol As Long, MyRow As Long
Dim MyAddress As String
Set ws1 = Sheets(“DealerNameRun”)
Set ws2 = Sheets(“SalesCalc”)
lc = ws1.Cells(1, Columns.Count).End(xlToLeft).Column
For MyCol = 1 To lc
MyAddress = “F68”
lr = ws1.Cells(Rows.Count, MyCol).End(xlUp).Row
For MyRow = 1 To lr
‘To put only the value of the cell to D27
ws2.Range(MyAddress).Value = ws1.Cells(MyRow, MyCol).Value
‘If you want to copy the whole cell’s contents to D27
‘ws1.Cells(MyRow, MyCol).Copy Destination:=ws2.Range(“D27”)
MyAddress = “F136”
Next MyRow
Next MyCol
End Sub