Data copy macro

I need an Excel macro to get data from One sheet to another Sheet.

I have a workbook with Two tabs. Tab 1:- BPTool and Tab 2:- PMG100. In PMG100 Tab from column A I need to copy all the Part numbers from A2 till the end (Numbers keep varying) and paste in BPTool Tab Column A13. For pasting this I need a VBA macro. Can anybody help in this
TEJAS NIMBALKARAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rob HensonFinance AnalystCommented:
Try this:

Sub Copy_Parts()

Sheets("PMG100").Range("A:A").ClearContents
For Each Cell In Range("Parts")
r = Cell.Row
v = Cell.Value
Sheets("PMG100").Range("A" & r).Value = v
Next Cell
End Sub

Open in new window


I have also created a dynamic range on BPTool with following formula:

=OFFSET(BPTool!$A$1,0,0,COUNTA(BPTool!$A:$A),1)
0
TEJAS NIMBALKARAuthor Commented:
Thanks for your expert comment, but the code is not working. Actually, I need to pick all the data from the column A from Tab PMG100. Eg:- 1, 2, 3, 4 and so on. It is showing error in this line. "For Each Cell In Range("Parts")". It will be helpful if we replace "parts" with some generic value. So whatever is there is the Column A it should capture in BPTool Tab column A which is starting from 13 row
0
Rob HensonFinance AnalystCommented:
Did you create the dynamic range?
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Does this work for you?

Sub CopyColumnA()
Dim sws As Worksheet, dws As Worksheet
Dim lr As Long
Application.ScreenUpdating = False
Set sws = Sheets("PMG100")
Set dws = Sheets("BPTool")
lr = sws.Cells(Rows.Count, 1).End(xlUp).Row
sws.Range("A2:A" & lr).Copy dws.Range("A13")
Application.ScreenUpdating = True
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TEJAS NIMBALKARAuthor Commented:
Thanks Mr. Subodh Toward for the macro help. You have always understand my queries very well.

 Many Thanks once again
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Tajas!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.