Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DD DD is offline
external usenet poster
 
Posts: 68
Default Copy column to new sheet and update

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
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
Copy and paste cahrt to new sheet-update data automatically? SKlee Charts and Charting in Excel 5 May 28th 07 02:00 PM
How to search column, copy row, and copy to another sheet in same Rockhound Excel Discussion (Misc queries) 1 December 9th 06 04:16 PM
Macro inserts a column but dont update formulas in another sheet! Stuart[_3_] Excel Programming 1 November 2nd 06 02:51 PM
how to make one column copy from one sheet to anoth column w/o zer areezm Excel Discussion (Misc queries) 3 June 6th 06 10:45 PM
Copying (Master) column to another sheet to automatically update LostInVirtualSpace Excel Worksheet Functions 0 September 19th 05 06:57 PM


All times are GMT +1. The time now is 06:55 AM.

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"