Reptile
19-12-06, 09:03 PM
As salamu alaikum
i basically want to merge these tables but dont know how, its also 2007 am not really sure if thats relevant or not heres a pic of what im trying to merge:
http://i145.photobucket.com/albums/r238/abira_bucket/table.jpg
any help is appreciated !:)
make sum extra lines and copy and paste :confused:
no right clicking merging needed :1popcorn:
or just beat me if its wrong..... :torture:
Reptile
19-12-06, 09:54 PM
lol thanks, i never thought of that as per usual i always like to go the complicated way :rolleyes:
From here:
http://www.experts-exchange.com/Applications/MS_Office/Excel/Q_20835937.html
try this:
Try the following sub. It assumes that the data is in columns A and B starting in row 2. It will paste the results over the original table, deleting any duplicate entries from column A and adding the values from column B to the first occurrence of the value in column A.
Sub TableConsolidater()
Dim rgData As Range, rwResults As Range
Dim k As Variant, X As Variant, Y() As Variant, Z() As Variant
Dim i As Long, j As Long
X = Range(Cells(2, 1), Cells(65536, 2).End(xlUp)).Value
ReDim Y(1 To UBound(X), 1 To 1)
ReDim Z(1 To UBound(X), 1 To 1)
For i = LBound(X) To UBound(X)
k = Application.Match(X(i, 1), Y, 0)
If IsError(k) Then
j = j + 1
Y(j, 1) = X(i, 1)
Z(j, 1) = X(i, 2)
Else
If InStr(1, Z(j, 1), X(i, 2)) = 0 Then Z(j, 1) = Z(j, 1) & ", " & X(i, 2)
End If
Next i
Range(Cells(2, 1), Cells(65536, 1).End(xlUp)).Value = Y
Range(Cells(2, 2), Cells(65536, 2).End(xlUp)).Value = Z
End Sub
To install a sub or function, ALT + F11 to open the VBA Editor. Insert...Module to create a blank module sheet. Paste the code there, then ALT + F11 to return to the spreadsheet.
To run a sub, ALT + F8 to open the macro window. Select the macro, then click the Run button.
If the above procedure doesn't work, then you need to change your macro security setting. To do so, open the Tools...Macro...Security menu item. Choose Medium, then click OK.
Hope that helps...
From here:
http://www.experts-exchange.com/Applications/MS_Office/Excel/Q_20835937.html
try this:
Hope that helps...
:smack: errr :eek3: i thing copy and paste was easier belal1 :buttkick:
:smack: errr :eek3: i thing copy and paste was easier belal1 :buttkick:
It's not the same. Copying and pasting only helps with static data. Say you have two tables which dynamically change you may want to merge them instead so even if the data changes, you don't have to do it manually...
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.