PC Review


Reply
Thread Tools Rate Thread

Copying data from cells A1,B1,C1 on tab1 to tab2

 
 
dannynic
Guest
Posts: n/a
 
      25th Nov 2009
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 With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      25th Nov 2009
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying data in cells Kimmie Microsoft Excel Worksheet Functions 3 5th Dec 2008 03:48 PM
copying data to different Cells =?Utf-8?B?QXV6?= Microsoft Excel Worksheet Functions 1 28th Apr 2006 02:28 PM
How to update dataset.Tables["tab1"] from records in dataset.Tables["tab2"]? AndiSHFR Microsoft C# .NET 1 12th Jan 2006 06:41 AM
setfocus from tab2 to tab1 in tabcontrol. jaYPee Microsoft VB .NET 7 27th Apr 2004 06:05 PM
Copying data without blank cells, and only certain cells Roshario Microsoft Excel Misc 4 22nd Nov 2003 05:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:51 AM.