LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Minimising VBA Code

Good morning,

I hope someone can help me with this.

I am busy designing a workbook that does the following:
Each client account is listed in a column on my first worksheet, with the
total quantity they are purchasing,
eg:
B C
8 Account Number Quantity
9 10001 10
10 H0002 10
11 AB003 10
12 B0005 10

Also, in cell C4 I have the purchase order reciept number, and in C5 I have
the date.

Each Account has its own worksheet within the workbook and I would like a
macro that copies the quantity from worksheet 1 and pastes it into the
correct client account worksheet.

I have used the following code, however it only copies and pastes the
information for the first account (there are going to be 80+!!), is there a
way I can loop the code so it does the procedure for every account listed in
the first worksheets columns?

Code I am using (with comments):
'Copy quantity bought by client 10001
Range("D9").Select
Selection.Copy
'Paste quantity bought by client 10001 to B19
Range("B19").Select
ActiveSheet.Paste
'Copy reciept reference number
Range("C4").Select
Application.CutCopyMode = False
Selection.Copy
'Paste receipt reference number to C19
Range("C19").Select
ActiveSheet.Paste
'Copy Date reference
Range("C5").Select
Application.CutCopyMode = False
Selection.Copy
'Past Date reference to A19
Range("A19").Select
ActiveSheet.Paste
'Copy format needed for client accout - Date(A19) Quantity(B19)
Reciept(C19)
With Sheets("10001")
lr = .Cells(Rows.Count, "a").End(xlUp).Row + 1
Rows("19").Copy .Rows(lr)
End With

Really would appreciate your help. If there is any confusion about what I
am asking, please ask and I will try to clarify. Thank you

Regards,
PVANS
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? [email protected] Excel Programming 4 May 29th 09 10:13 PM
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does ker_01 Excel Programming 6 October 3rd 08 09:45 PM
Minimising the Ribbon in an Auto_Open macro Jeff Wiggins Excel Discussion (Misc queries) 3 May 9th 08 03:35 PM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM
Minimising Excel Jason Zischke Excel Programming 2 January 20th 06 02:56 AM


All times are GMT +1. The time now is 06:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"