PC Review


Reply
Thread Tools Rate Thread

Copy column to new sheet and update

 
 
dd
Guest
Posts: n/a
 
      14th Jul 2008
I have a few worksheets in an excel workbook.
In worksheet one, Column C there is a list of names sorted in descend spend
order.
This list of names is dynamic and will change.
In worksheet two, Column A is a list I manually copied from Column C in
wksht one and sorted with vba code (see below). Also in column B, is a pic
number that goes with column A name.
Basically, when worksheet one names change and updates, I want a new list of
sorted names in worksheet two Column A, but the column b will have the
corresponding pic number and be unchanged. I want a code to automate this
process so I don't have to copy and paste each time.

For example,
Col A Col B
CompanyAd Pic1
CompanyBo Pic2

If CompanyAp is added, CompanyBo and Pic2 will be moved down one row,
leaving a blank cell in Column B for CompanyAp.

CompanyAd Pic1
CompanyAp
CompanyBo Pic2


Any help is appreciated? thanks


Below is the code I use to sort in ascending order for Column A.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Columns("A:B").Sort key1:=Range("A1"), header:=xlNo
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


 
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
Match value from column A to column A on 2nd sheet and then copy R DanS Microsoft Excel Programming 2 16th Feb 2009 09:03 PM
Copy from Sheet 1 to Last available cell in specified column =?Utf-8?B?Q2FybGVl?= Microsoft Excel Programming 3 7th Jul 2007 10:54 PM
How to search column, copy row, and copy to another sheet in same =?Utf-8?B?Um9ja2hvdW5k?= Microsoft Excel Misc 1 9th Dec 2006 04:16 PM
how to make one column copy from one sheet to anoth column w/o zer =?Utf-8?B?YXJlZXpt?= Microsoft Excel Misc 3 6th Jun 2006 10:45 PM
Copy column from one sheet to another =?Utf-8?B?SmFjcXVpZQ==?= Microsoft Excel Misc 1 5th Dec 2005 09:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:58 AM.