Copy Values with VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top