PC Review


Reply
Thread Tools Rate Thread

Concetating Two Columns in Excel VBA

 
 
AyeJay
Guest
Posts: n/a
 
      27th Mar 2007
I'm not sure if Concetating is the exact way to go about this but what
I'm trying to do is take:

Drawing Amount | Drawing Number
--------------------------------------------------
4 506888
6 506889
2 506888
3 506889


And make it look like:


Drawing Amount | Drawing Number
--------------------------------------------------
6 506888
9 506889


Through a button-push on VBA.
Anyone have any ideas on how to accomplish this?

 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      27th Mar 2007
The following assumes your data is in cells A1:B5 of Sheet1.

Sub Macro1()
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
ws.Range("B1:B5").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=ws.Range("E1"), Unique:=True
ws.Range("D2").FormulaR1C1 =
"=SUMIF(RC[-2]:R[3]C[-2],RC[1],RC[-3]:R[3]C[-3])"
ws.Range("D2").Copy ws.Range("D3")
ws.Range("D2:E3").Copy
ws.Range("D2").PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
ws.Range("A2:B5").Clear
ws.Range("D2:E3").Copy ws.Range("A2")
ws.Range("D1:E3").Clear
End Sub

Hth,
Merjet


 
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
Merge Two Excel Columns into 1 Columns skpan1 Microsoft Excel Programming 0 13th Apr 2011 10:10 AM
putting 2 long columns into multiple columns in excel page and sor bob_mhc Microsoft Excel Misc 1 25th Apr 2008 07:51 AM
Excel 2007 extra columns - but transposing columns still not working! garyusenet@myway.com Microsoft Excel Programming 0 26th Jul 2006 02:58 PM
How to merge columns from excel and how to set customize each columns lancelot Microsoft Excel Programming 0 25th Mar 2006 03:44 AM
Excel button :: Filter columns by value - possible? Additionally, hide certain columns Microsoft Excel Programming 4 28th Dec 2004 07:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:24 AM.