Hey gang,
I am new to excel macros. I have plenty of vba experience so I think we could do this easily.
I have a spreadsheet with several tabs. the overall goal is this
Search for values in the Sheet called "BOM" in the "O" column. If the O column says "D" then we need to go to the sheet called BOM HEADERS and copy row 9 and 10 and insert them back onto the BOM sheet right above where you found the "D" in column "O". Then i need to search BOM sheet for "p". if found insert the rows 34 and 35 on sheet "BOM HEADERS" back onto sheet "BOM" above the first instance of a row that has "p" in the "O" column. I am basically wanting to take these headers and paste them back on the first sheet so i can have a pretty looking spreadsheet. it is too manual now and wastes lots of time. Once i have all my headers in place i want to copy all the values from sheet "BOM" to sheet "PACKING LIST". once i have done this i want to delete all the rows that have a column "A" value containing a decimal. So it will copy the values from sheet "BOM" and past them onto sheet "PACKING LIST" and then on sheet "PACKING LIST" delete all the rows that have a value in the first colum like 2.1. so all the packing list will show is whole number rows. I hope this is descriptive enough. I will paste the code i have so far.
it wont let me attach the spreadsheet. keep getting an database error
Dim LSearchRow As Integer
'Start search in column 15
LSearchRow = 1
While Len(Range("A" & CStr(LSearchRow)).Value) > 0
If Range("O" & CStr(LSearchRow)).Value = "D" Then
'Select DuctWork Header and copy
Sheets("BOM HEADERS").Select
Rows(9).Select
Selection.Copy
'Paste into bom
Sheets("BOM").Select
Rows(CStr(LSearchRow)).Select
ActiveSheet.Paste
'Move counter to next row
'Go back to Sheet1 to continue searching
Sheets("BOM").Select
End If
LSearchRow = LSearchRow + 1
Wend
Bookmarks