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: 12
Default Simplify a macro

Im working on a project and want to print out different pricelists depending
on postal code, without using Word. I need to copy values from a list of
name, address and postal code (A2:C30), paste it, print it and then move to
the next name in the list.

All information is stored in the same workbook. Prices in the Worksheet
called price and address inn address and some values and function in a
worksheet called Intern forside. Each customer generates different prices
depending on his postal number. So I want to print out different prices to
lots of customers, but in this example is only from adress!A2:C30

If I try to registry the macro manually I will look like this:

ex_macro Makro
' Makro registrert 22.08.2005 av eho
'

'
Sheets("adress").Select
Range("A2").Select
Selection.Copy
Sheets("Intern forside").Select
Range("B14").Select
ActiveSheet.Paste
Sheets("adress").Select
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intern forside").Select
Range("B15").Select
ActiveSheet.Paste
Sheets("adress").Select
Range("C2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intern forside").Select
Range("B17").Select
ActiveSheet.Paste
Sheets("price").Select
Application.CutCopyMode = False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("adress").Select
Range("A3").Select
Selection.Copy
Sheets("Intern forside").Select
Range("B14").Select
ActiveSheet.Paste
Sheets("adress").Select
Range("B3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intern forside").Select
Range("B15").Select
ActiveSheet.Paste
Sheets("adress").Select
Range("C3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intern forside").Select
Range("B17").Select
ActiveSheet.Paste
Sheets("price").Select
Application.CutCopyMode = False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

and so on.. until last customer line 30.


I know it has to be an easier way of doing this?
May bee someone can help me.

Einar


 
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
I need to simplify this... j5b9721 Excel Worksheet Functions 5 July 23rd 09 09:03 AM
Simplify this macro Sunnyskies Excel Discussion (Misc queries) 4 February 9th 07 12:05 PM
simplify a macro Shooter Excel Worksheet Functions 3 January 31st 07 06:22 PM
please help simplify acarril[_10_] Excel Programming 1 September 21st 04 07:39 PM
looking to simplify a recorded macro with code HM Excel Programming 2 February 10th 04 06:35 PM


All times are GMT +1. The time now is 02:36 PM.

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"