Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I posted a question here but recieved no responses so I shall re-phrase
the question in the hope that someone will take the bait. Sheet 1. When a specific value (CH) is selected from a drop down list (in column M), I would like to have all the data from cells on the same row (A-K) copied to the next empty row in Sheet 2. So, the theory is that data is entered by the user in cells A-M. When the option 'CH' is selected from the list of options in cell M, A-K is copied to Sheet 2 and the user is taken to Sheet 2 to add text if necessary. Can someone advise if this is achievable or do I have to try a different approach? Thanks. -- Traa Dy Liooar Jock |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
there are two way of doing theis. First to use a worksheet change function
when the drop down box is changed to move the data. but this is not really a great way of doing this because if the wrong value is selected unwanted data will be copied. the second method is to use a Button to perform the operation after the value is selected which willreduce the number of wrong items theat will be moved. 1) Is the Drop down List a Data validation or an Autofilter? 2) What cell is the Drop down list Located? "Jock" wrote: Hi, I posted a question here but recieved no responses so I shall re-phrase the question in the hope that someone will take the bait. Sheet 1. When a specific value (CH) is selected from a drop down list (in column M), I would like to have all the data from cells on the same row (A-K) copied to the next empty row in Sheet 2. So, the theory is that data is entered by the user in cells A-M. When the option 'CH' is selected from the list of options in cell M, A-K is copied to Sheet 2 and the user is taken to Sheet 2 to add text if necessary. Can someone advise if this is achievable or do I have to try a different approach? Thanks. -- Traa Dy Liooar Jock |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Joel,
Good thinking about the button to reduce wrong entries. The drop down list is a Data Validation and is located in each cell in column 'M' on Sheet 1. Cheers, -- Traa Dy Liooar Jock "Joel" wrote: there are two way of doing theis. First to use a worksheet change function when the drop down box is changed to move the data. but this is not really a great way of doing this because if the wrong value is selected unwanted data will be copied. the second method is to use a Button to perform the operation after the value is selected which willreduce the number of wrong items theat will be moved. 1) Is the Drop down List a Data validation or an Autofilter? 2) What cell is the Drop down list Located? "Jock" wrote: Hi, I posted a question here but recieved no responses so I shall re-phrase the question in the hope that someone will take the bait. Sheet 1. When a specific value (CH) is selected from a drop down list (in column M), I would like to have all the data from cells on the same row (A-K) copied to the next empty row in Sheet 2. So, the theory is that data is entered by the user in cells A-M. When the option 'CH' is selected from the list of options in cell M, A-K is copied to Sheet 2 and the user is taken to Sheet 2 to add text if necessary. Can someone advise if this is achievable or do I have to try a different approach? Thanks. -- Traa Dy Liooar Jock |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton1_Click()
If ActiveCell.Value = "CH" Then RowNo = ActiveCell.Row With ActiveSheet Set CopyRange = .Range("A" & RowNo & ":K" & RowNo) End With With Sheets("Sheet2") Lastrow = .Range("A" & Rows.Count).End(xlUp).Row NewRow = Lastrow + 1 CopyRange.Copy Destination:=.Range("A" & NewRow) End With End If End Sub "Jock" wrote: Hi Joel, Good thinking about the button to reduce wrong entries. The drop down list is a Data Validation and is located in each cell in column 'M' on Sheet 1. Cheers, -- Traa Dy Liooar Jock "Joel" wrote: there are two way of doing theis. First to use a worksheet change function when the drop down box is changed to move the data. but this is not really a great way of doing this because if the wrong value is selected unwanted data will be copied. the second method is to use a Button to perform the operation after the value is selected which willreduce the number of wrong items theat will be moved. 1) Is the Drop down List a Data validation or an Autofilter? 2) What cell is the Drop down list Located? "Jock" wrote: Hi, I posted a question here but recieved no responses so I shall re-phrase the question in the hope that someone will take the bait. Sheet 1. When a specific value (CH) is selected from a drop down list (in column M), I would like to have all the data from cells on the same row (A-K) copied to the next empty row in Sheet 2. So, the theory is that data is entered by the user in cells A-M. When the option 'CH' is selected from the list of options in cell M, A-K is copied to Sheet 2 and the user is taken to Sheet 2 to add text if necessary. Can someone advise if this is achievable or do I have to try a different approach? Thanks. -- Traa Dy Liooar Jock |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That works a treat, thanks.
Is it possible to just paste values ie, no formatting? Also can the user be taken to Sheet 2 when the button is clicked? That would help a lot too! There's already a button there to return the user to the active cell on Sheet 1. Thanks -- Traa Dy Liooar Jock "Joel" wrote: Private Sub CommandButton1_Click() If ActiveCell.Value = "CH" Then RowNo = ActiveCell.Row With ActiveSheet Set CopyRange = .Range("A" & RowNo & ":K" & RowNo) End With With Sheets("Sheet2") Lastrow = .Range("A" & Rows.Count).End(xlUp).Row NewRow = Lastrow + 1 CopyRange.Copy Destination:=.Range("A" & NewRow) End With End If End Sub "Jock" wrote: Hi Joel, Good thinking about the button to reduce wrong entries. The drop down list is a Data Validation and is located in each cell in column 'M' on Sheet 1. Cheers, -- Traa Dy Liooar Jock "Joel" wrote: there are two way of doing theis. First to use a worksheet change function when the drop down box is changed to move the data. but this is not really a great way of doing this because if the wrong value is selected unwanted data will be copied. the second method is to use a Button to perform the operation after the value is selected which willreduce the number of wrong items theat will be moved. 1) Is the Drop down List a Data validation or an Autofilter? 2) What cell is the Drop down list Located? "Jock" wrote: Hi, I posted a question here but recieved no responses so I shall re-phrase the question in the hope that someone will take the bait. Sheet 1. When a specific value (CH) is selected from a drop down list (in column M), I would like to have all the data from cells on the same row (A-K) copied to the next empty row in Sheet 2. So, the theory is that data is entered by the user in cells A-M. When the option 'CH' is selected from the list of options in cell M, A-K is copied to Sheet 2 and the user is taken to Sheet 2 to add text if necessary. Can someone advise if this is achievable or do I have to try a different approach? Thanks. -- Traa Dy Liooar Jock |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use pastespecial to pate values only
Private Sub CommandButton1_Click() If ActiveCell.Value = "CH" Then RowNo = ActiveCell.Row With ActiveSheet Set CopyRange = .Range("A" & RowNo & ":K" & RowNo) End With With Sheets("Sheet2") Lastrow = .Range("A" & Rows.Count).End(xlUp).Row NewRow = Lastrow + 1 CopyRange.Copy .Range("A" & NewRow).pastespecial paste:=xlPasteValues ..activate End With End If End Sub "Jock" wrote: That works a treat, thanks. Is it possible to just paste values ie, no formatting? Also can the user be taken to Sheet 2 when the button is clicked? That would help a lot too! There's already a button there to return the user to the active cell on Sheet 1. Thanks -- Traa Dy Liooar Jock "Joel" wrote: Private Sub CommandButton1_Click() If ActiveCell.Value = "CH" Then RowNo = ActiveCell.Row With ActiveSheet Set CopyRange = .Range("A" & RowNo & ":K" & RowNo) End With With Sheets("Sheet2") Lastrow = .Range("A" & Rows.Count).End(xlUp).Row NewRow = Lastrow + 1 CopyRange.Copy Destination:=.Range("A" & NewRow) End With End If End Sub "Jock" wrote: Hi Joel, Good thinking about the button to reduce wrong entries. The drop down list is a Data Validation and is located in each cell in column 'M' on Sheet 1. Cheers, -- Traa Dy Liooar Jock "Joel" wrote: there are two way of doing theis. First to use a worksheet change function when the drop down box is changed to move the data. but this is not really a great way of doing this because if the wrong value is selected unwanted data will be copied. the second method is to use a Button to perform the operation after the value is selected which willreduce the number of wrong items theat will be moved. 1) Is the Drop down List a Data validation or an Autofilter? 2) What cell is the Drop down list Located? "Jock" wrote: Hi, I posted a question here but recieved no responses so I shall re-phrase the question in the hope that someone will take the bait. Sheet 1. When a specific value (CH) is selected from a drop down list (in column M), I would like to have all the data from cells on the same row (A-K) copied to the next empty row in Sheet 2. So, the theory is that data is entered by the user in cells A-M. When the option 'CH' is selected from the list of options in cell M, A-K is copied to Sheet 2 and the user is taken to Sheet 2 to add text if necessary. Can someone advise if this is achievable or do I have to try a different approach? Thanks. -- Traa Dy Liooar Jock |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy specific data to second worksheet | New Users to Excel | |||
Copy specific records from a worksheet to another | Excel Worksheet Functions | |||
Copy specific data over to other worksheet | Excel Programming | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
Copy and pasting specific sheet data to a master worksheet | Excel Programming |