Function to fill down extra columns with names

Slizer6893

Active Member
Joined
Oct 25, 2013
Messages
271
Alright hopefully this is fairly straight forward I just can't think of the easiest way to do this. Basically I have two sheets, one I am changing one thing a Model # in B1, this auto updates the Item Name in B2...

The model number is already set up to pull all the data I need in my sheet which then creates totals at the bottom. These totals I have pulled to a summary sheet through this code

Code:
Sub CopytoSummary()'
Dim Copysheet As Worksheet
Dim pastesheet As Worksheet
Dim lr As Long
Dim rng As Range






Set Copysheet = Worksheets("Overlay Filler")
Set pastesheet = Worksheets("Take Summary")
'Set each variable
lr = pastesheet.Cells(Rows.Count, 1).End(xlUp).Row


Copysheet.Range("E365:BG372").Copy


pastesheet.Range("c2").End(xlDown).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Transpose:=True




End Sub

Fairly simple code that's only purpose is to get the data under the last model # I did. However I need to fill column A with the model number that the code last was used with, and column B with the item name. I could add them to the bottom near the totals and include them in the copying but I want to avoid going that route.

If I have to use that route I will but I feel like I could do something during the copying/pasting that also grabs B1 and B2 and fills column A/B with it to the last row that was copied over with my macro.


I will keep testing to see if I can figure it out

Thanks!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Code:
lr = Range("C" & Rows.Count).End(xlUp).Row

    Range("A3").AutoFill Destination:=Range("DC3:D" & lastRow)

I think something like this will work just trying to figure it out
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,517
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top