#1   Report Post  
Anthony
 
Posts: n/a
Default Data Validation

Hi,
is it possible to programme an option in a validation
list so that when the option, say "print", is selected
the last row of data entered on a worksheet is copied and
pasted into the next available row in another worksheet.
For example, when the "print" option is selected from the
drop down menu , all the data on cells A5:P5 are selected
(as this is the last info enterd on this worksheet) and
then paste it into cells A45:P45 in another worksheet as
this is the next available row !
Hope I have made myself clear and thanks in advance
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I think I'd use a dedicated macro (maybe assigned to a button from the Forms
toolbar on a nice spot on that worksheet):

This assumes that the next open row can be determined by looking at column A.

Option Explicit
Sub testme()
Dim RngToCopy As Range
Dim DestCell As Range

Set RngToCopy = ActiveSheet.Range("a5:p5")

With Worksheets("sheet2")
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

ActiveSheet.PrintOut preview:=True

RngToCopy.Copy _
Destination:=DestCell

'rngtocopy.clearcontents 'maybe????

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

And remove the "Preview:=true" when you're done testing. (I didn't want to kill
too many trees while testing!)

Anthony wrote:

Hi,
is it possible to programme an option in a validation
list so that when the option, say "print", is selected
the last row of data entered on a worksheet is copied and
pasted into the next available row in another worksheet.
For example, when the "print" option is selected from the
drop down menu , all the data on cells A5:P5 are selected
(as this is the last info enterd on this worksheet) and
then paste it into cells A45:P45 in another worksheet as
this is the next available row !
Hope I have made myself clear and thanks in advance


--

Dave Peterson
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
Effect of Conditional Formatting, Data Validation Bill Sturdevant Excel Discussion (Misc queries) 1 January 25th 05 11:50 PM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 05:55 PM
Data Validation Window? Ken Excel Discussion (Misc queries) 1 January 11th 05 10:48 PM
Excel2K: Is it possible to use dynamic named ranges in custom data validation formula? Arvi Laanemets Excel Discussion (Misc queries) 0 December 2nd 04 11:29 AM
data validation on sth else [email protected] Excel Worksheet Functions 1 November 3rd 04 01:52 PM


All times are GMT +1. The time now is 01:11 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"