Self taught... Needing some help pasting information from "DW" to tables... Code pastes to the tables correctly for "Range A" of target worksheet, but the table expands to the bottom of "Range A" when the information is pastes and "Range B,C,D,E, ETC" offsets below the previous range in the table of concern. Pic at bottom of post. Thanks!
Code:
[COLOR=#333333][FONT=Verdana]Dim DW As Worksheet[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim WFIT As Worksheet[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim EIT As Worksheet[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim PIT As Worksheet[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim BIT As Worksheet[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim MIT As Worksheet[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim N As Long[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim M As Long[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim O As Long[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Dim P As Long[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Set DW = Worksheets("DailyWorksheet")[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Set WFIT = Worksheets("WorkForceInformationTable")[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Set EIT = Worksheets("EquipmentInformationTable")[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Set PIT = Worksheets("ProjectInformationTable")[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Set BIT = Worksheets("BidItemInformationTable")[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Set MIT = Worksheets("MaterialInformationTable")[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Application.ScreenUpdating = False[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'Selects Cell C8 or Down 8 and Over 3[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]N = Cells(8, 3).End(xlDown).Row[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'Contractor's WorkForce Section[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("C8:C" & N).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]WFIT.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("B8:B" & N).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]WFIT.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("A8:A" & N).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]WFIT.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("V8:V" & N).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]WFIT.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("W8:W" & N).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]WFIT.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("X8:X" & N).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]WFIT.Cells(Rows.Count, 6).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'Contractor's Equipment Section[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'Selects Cell G8 or Down 8 and Over 7[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]M = Cells(8, 7).End(xlDown).Row[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("G8:G" & M).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]EIT.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("F8:F" & M).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]EIT.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("Y8:Y" & M).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]EIT.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("Z8:Z" & M).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]EIT.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("AA8:AA" & M).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]EIT.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'Bid Items Installed Section[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'Selects Cell G19 or Down 19 and Over 7[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]O = Cells(19, 2).End(xlDown).Row[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("A19:A" & O).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]BIT.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("B19:B" & O).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]BIT.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("D19[/FONT][/COLOR]:D"[COLOR=#333333][FONT=Verdana] & O).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]BIT.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("E19:E" & O).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]BIT.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("V19:V" & O).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]BIT.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("W19:W" & O).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]BIT.Cells(Rows.Count, 6).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("X19:X" & O).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]BIT.Cells(Rows.Count, 7).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'Materials Used Section[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'Selects Cell G19 or Down 19 and Over 7[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]P = Cells(19, 7).End(xlDown).Row[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("G19:G" & P).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]MIT.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("F19:F" & P).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]MIT.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("J19:J" & P).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]MIT.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("Y19:Y" & P).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]MIT.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("Z19:Z" & P).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]MIT.Cells(Rows.Count, 5).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]DW.Range("AA19:AA" & P).Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]MIT.Cells(Rows.Count, 6).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]End Sub[/FONT][/COLOR]
Picture is of WFIT worksheet after information is copied from DW worksheet.
Last edited by a moderator: