View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
[email protected] bstevens@rock.com is offline
external usenet poster
 
Posts: 23
Default PLEASE help with cut/paste macro

I have two worksheets: "residential" and "blanktables"

"Residential" has a 27-row form people fill out. The user fills out
one form per student.

Since most users have many students, I'm trying to make a button on
the last line of the form so that when the user clicks it, it
executes a macro that inserts a new, blank form for another student.

The macro goes to "blanktables" and selects an empty blank form;

Returns to "Residential" and pastes a new blank form below the first
one (the first row below the button). There's a button on the bottom
of the new blank form running the same macro, in case the user wants
to add another form below that one. Then another one below that one,
and so on. Some users have over 100 students.

At first I just created the button and performed the task using
"Record New Macro." It worked fine. BUT every time the user clicks the
button on the NEW form, it pastes it in the same place, over and over.
How can I keep it from doing this? It needs to paste it on the row
below the button, no matter where the button is.

The recorded macro looks like this (the button is on A30):

Sheets("blanktables").Select
Range("A1:B29").Select
Selection.Copy
Sheets("Residential").Select
Range("A31").Select
ActiveSheet.Paste

Please reply to the newsgroup.
THanks a heap,
Ron M.