#1   Report Post  
Posted to microsoft.public.excel.misc
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Copy Values with VBA

Hello everyone, I would like to run a Macro that each time I do (by the way,
it will be used for printing and registering), right now I have this:

------------------------------------

Sub Print_Register()
'
' Keyboard Shortcut: Ctrl+Shift+P
'
Sheets("PRINT FORM").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
End Sub

-------------------------------------

To add a code that will copy certain values from "Sheet A" that acts as a
form (some of these values are =today() and vlookups and so on, so I need to
paste "As Value") into "Sheet B" that should act in a list-kind-of-way. I
need:

"Sheet A" to take K2 and put it into "Sheet B" A2
"Sheet A" to take K12 and put it into "Sheet B" B2
"Sheet A" to take E2 and put it into "Sheet B" C2
"Sheet A" to take M50 and put it into "Sheet B" D2

.... and so on...
and next time I run the macro to copy those values from Sheet A but now to
insert them into Row 3, then Row 4, then Row 5, and so on... (or if it is
possible to keep the last-entries-first-in-the-list order and so on that is
even better!)

any ideas?

,thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Copy Values with VBA

try this. Pls notice the use of . before the items in the with statement.
Also notice NO selections.

Sub Print_Register()
Keyboard Shortcut: Ctrl+Shift+P
with sheets("print_form")
.range("a2").value=range("k2")
.range("b2").value=range("k12")
.range("c2").value=range("e2")
.range("d2").value=range("m50")
.printout
end with
end sub
--
Don Guillett
SalesAid Software

"Ed" wrote in message
...
Hello everyone, I would like to run a Macro that each time I do (by the
way,
it will be used for printing and registering), right now I have this:

------------------------------------

Sub Print_Register()
'
' Keyboard Shortcut: Ctrl+Shift+P
'
Sheets("PRINT FORM").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
End Sub

-------------------------------------

To add a code that will copy certain values from "Sheet A" that acts as a
form (some of these values are =today() and vlookups and so on, so I need
to
paste "As Value") into "Sheet B" that should act in a list-kind-of-way. I
need:

"Sheet A" to take K2 and put it into "Sheet B" A2
"Sheet A" to take K12 and put it into "Sheet B" B2
"Sheet A" to take E2 and put it into "Sheet B" C2
"Sheet A" to take M50 and put it into "Sheet B" D2

... and so on...
and next time I run the macro to copy those values from Sheet A but now to
insert them into Row 3, then Row 4, then Row 5, and so on... (or if it is
possible to keep the last-entries-first-in-the-list order and so on that
is
even better!)

any ideas?

,thanks!



  #3   Report Post  
Posted to microsoft.public.excel.misc
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Copy Values with VBA

Thanks Don!
Reply
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
copy graphs values in a cell bluepill Charts and Charting in Excel 3 June 29th 06 05:45 PM
how to get rid of " " when copy values? Eldna Excel Discussion (Misc queries) 1 November 2nd 05 02:59 PM
Copy VLookup Values Karen Excel Worksheet Functions 3 July 12th 05 04:50 PM
How to copy values in various rows automatically Me Excel Discussion (Misc queries) 5 March 7th 05 05:09 PM
How do I copy only sub-totalled values - without any detail? Parkperson Excel Worksheet Functions 1 December 16th 04 08:26 PM


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

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

About Us

"It's about Microsoft Excel"