I have a workbook that has two worksheets, "Bid Sheet" and "Proposal" I would like to loop through the "bid sheets" rows and paste them over to the proposal sheet. The bid sheet could have 1 row to paste or 20 rows, depending on the job. I have the cells named, item1, Desc1, Quan1, and Unit1, then item2, Desc2, Etc.... My boss will sometimes delete a row in the bid sheet as well, so I have to delete the empty rows as well. I was going to start by copying and pasting the cells down, so I could delete the empty rows before pasting. Not sure if that's the correct method.
I'm new to VBA and google has been my friend. I was trying to loop and change the named cells based on the loop, but again, I'm stuck. Forgive my messy code
Here is my workbook
The copy paste part works flawless, but that's it. The above code is not finished, of course, but it's where I was stumped.
I'm new to VBA and google has been my friend. I was trying to loop and change the named cells based on the loop, but again, I'm stuck. Forgive my messy code
Here is my workbook
VBA Code:
Sub proposal()
Dim i As Long
Dim j As Long
Dim x As Range
Dim RowNumP As Long
Dim shB As Worksheet
Dim shP As Worksheet
Dim r As Long
Application.ScreenUpdating = False
Set shB = Sheets("Bid Sheet")
Set shP = Sheets("Proposal")
RowNumP = shB.Cells(Rows.Count, 1).End(xlUp).Row
Range("A9:D50").Copy Destination:=shB.Range("A60")
For i = 110 To 60 Step -1
If Trim(Cells(i, 2)) = “” Then
Rows(i).Delete
End If
Next
shP.Activate
For j = 1 To RowNumP Step 3
For r = 60 To 110
Cells(j, 1).Value = shB.Cells(r - 1, 2)
Next r
Next j
End Sub
The copy paste part works flawless, but that's it. The above code is not finished, of course, but it's where I was stumped.