Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default MACRO: Selecting "Cancel" from a drop down to copy and paste entirerow to another sheet

I am trying to create a macro for a project management sheet in
excel. I have a column that has a drop down validation; when
"Cancel"
is selected, I would like the entire row to be moved to "Sheet2" in
the workbook. I want this to work for all of the projects (each
listed on a different row). I do not have that much experience with
macros, so detailed instructions will be grately appreciated :)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default MACRO: Selecting "Cancel" from a drop down to copy and paste entire row to another sheet

Nicole,

Copy the code below, right-click the sheet tab, select "View Code" and paste the code in the window
that appears.

Change the 1 in this line

If Target.Column < 1 Then Exit Sub

to the number of the "column that has a drop down validation" A=1, B=2, etc...

If Sheet2 is not named "Sheet2" then change it in this line:

Target.EntireRow.Copy Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp)(2)


HTH,
Bernie
MS Excel MVP


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 1 Then Exit Sub
If Target.Cells.Count 1 Then Exit Sub
If Target.Value < "Cancel" Then Exit Sub
Application.EnableEvents = False
Target.EntireRow.Copy Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp)(2)
Target.EntireRow.Delete
Application.EnableEvents = True
End Sub


"Nicole Hannington" wrote in message
...
I am trying to create a macro for a project management sheet in
excel. I have a column that has a drop down validation; when
"Cancel"
is selected, I would like the entire row to be moved to "Sheet2" in
the workbook. I want this to work for all of the projects (each
listed on a different row). I do not have that much experience with
macros, so detailed instructions will be grately appreciated :)



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
MACRO: Selecting "Cancel" from a drop down to copy and paste entirerow to another sheet Nicole Hannington Excel Discussion (Misc queries) 1 July 20th 09 07:11 PM
[newbie] Macro for "copy and paste" Jon Excel Discussion (Misc queries) 1 April 2nd 09 10:36 AM
problem with Linking workbooks via "copy" and "paste link" Arkitek Excel Discussion (Misc queries) 0 December 19th 06 10:03 PM
Macro to find copy "header" and paste RunsWithKnives Excel Discussion (Misc queries) 3 March 27th 06 05:55 AM
Auto "copy and paste" individual cells from various sheets into one sheet ?? [email protected] Excel Discussion (Misc queries) 2 March 1st 06 03:19 AM


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