Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Copying data from cells A1,B1,C1 on tab1 to tab2
I want to copy data from cells A, B and C on Tab 1 of my workbook to other
tabs in my workbook dependant on which option is selected from a dropdown list in cell D of Tab1 Example: I have 'company name' in cell A, 'Account Number' in Cell B and 'Sales' in cell C on tab 1, I then select 'Blue' from a dropdown list in cell D on tab 1. I then want excel to copy the data in cells A, B and C, on tab 1 into another tab in the same workbook named 'Blue'. can anybody help please???? -- Thanks, Dan |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Copying data from cells A1,B1,C1 on tab1 to tab2
Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the right blank portion. Get back to to workbook and try out. Private Sub Worksheet_Change(ByVal Target As Range) Dim lngLastRow As Long Application.EnableEvents = False If Target.Column = 4 And Target.Count = 1 Then If Target.Text < "" Then lngRow = Sheets(CStr(Target.Text)).Cells(Rows.Count, "A").End(xlUp).Row + 1 Me.Range("A" & Target.Row).Resize(, 3).Copy _ Sheets(CStr(Target.Text)).Range("A" & lngRow) End If End If Application.EnableEvents = True End Sub If this post helps click Yes --------------- Jacob Skaria "dannynic" wrote: I want to copy data from cells A, B and C on Tab 1 of my workbook to other tabs in my workbook dependant on which option is selected from a dropdown list in cell D of Tab1 Example: I have 'company name' in cell A, 'Account Number' in Cell B and 'Sales' in cell C on tab 1, I then select 'Blue' from a dropdown list in cell D on tab 1. I then want excel to copy the data in cells A, B and C, on tab 1 into another tab in the same workbook named 'Blue'. can anybody help please???? -- Thanks, Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copying data in cells | Excel Worksheet Functions | |||
Copying data from 2 cells into 1 | Excel Worksheet Functions | |||
copying data to different Cells | Excel Worksheet Functions | |||
Copying Data Between Cells | Links and Linking in Excel | |||
Automatic copying of data cells | Excel Discussion (Misc queries) |