Merge Columns Without Losing Data Conditionally
Oct 30, 2013
My data is in column A , Column B and Column C, where are column C has a uniuqe value for certain rows.
Based on these uniques value, column A and Column B should be merged to singe Row without loosing data.
MY Data:
Source address
Destination address
Destination Port
Application
IP Protocol
192.168.1.2
192.168.250.10
53
dns
udp
[Code] .......
Result expecting is :
Source address
Destination address
Destination Port
Application
IP Protocol
[Code] .......
View 7 Replies
ADVERTISEMENT
Nov 14, 2008
I've got two columns:
A, B
abc, def
qwe, rty
asd, fgh
zxc, vbn
And I need to bring these together in one column so it looks like this
C
abcdef
qwerty
asdfgh
zxcvbn
View 2 Replies
View Related
Jun 27, 2014
I am trying a macro to merge cell without losing the data until I find a next cell with the data - This merging should be pertain only for the column selected. Is it possible to write a macro and preform this activity.
View 1 Replies
View Related
Aug 3, 2012
I have 4 different workbooks that I want to merge into one workbook. I tried moving the sheets from these workbooks into one workbook but to my surprise all the vba / macros didn't transfer over to the other workbook.
I searched here but all I can find were people that wanted to make a summary workbook or merge workbooks into a worksheet which isn't what i want to do.
I just want to simply merge these workbooks into one workbook without losing all the marco and vba stuff that are in each workbook.
View 2 Replies
View Related
Jun 7, 2014
I am having data in two columns (A & B ). Now I want to get the data in the single column(column C) . Here column A(Name) & Column B(Mobile No). it is something like below.
Here is my input data:
I want to get output results like below in the column C
View 7 Replies
View Related
Dec 19, 2012
So I have several columns of data that have a location and then some numbers after it in additional columns. I need to be able to sort it so that all locations that are in both location columns are sorted first, and then any locations that are in one column but not the other column follows. Also the data associated with each column that follows the location needs to remain next to the location. Many times the columns will be of highly disportionate lengths too.
I've attached an HTML table so you can get an idea of what I am looking at, except what I'm dealing with is like.... hundreds of cells long.
I want to be able to turn this:
HTML Code:Â
<table border="1" bordercolor="#FFCC00" style="background-color:#FFFFCC" width="100%" cellpadding="3" cellspacing="3">
<tr>
<td>A</td>
[Code].....
And in this 6 row example, I'd actually only be interested in the 4 letters that were in both columns. If it makes it easier, I would be okay with discarding the last rows, but would rather just have them sorted at the end, so I could check if....for example there were two different spellings of the same thing, and they should actually be included.
View 3 Replies
View Related
Jun 7, 2012
I use the following code to merge all data a "master sheet", but I want to take the data and put it next to each other on the "master sheet", not under. For example, my range of data is "A1:D15" and I want to copy from all sheets. So my first paste would be A1:D15, then the next should be E1:H15.
I would like the code to find the used range, like it does currently.
Code:
Sub Merge()
Dim ws As Worksheet
ActiveSheet.UsedRange.Offset(0).Clear
[Code]....
View 1 Replies
View Related
Sep 27, 2013
I've found macro, which merge rows with the same data
Example:
BEFORE:
january
1st
january
2nd
[Code] ........
Macro:
Option Explicit
Sub MergeSame()
Dim r As Range, c As Range
Dim i As Long, j As Long
Set r = Range("a1", Cells(Rows.Count, "a").End(xlUp))
[Code] .....
But i need use the same procedure for columns, it means:
BEFORE
A
B
C
D
E
F
january
january
january
february
february
february
AFTER
A
B
C
D
E
F
january
february
I've tried modified macro marked above, but without success...
View 3 Replies
View Related
Mar 12, 2014
I have 2 columns full of information feeding from 2 different sources on our internet database
I would like to collect this information into 1 column to create a drop down list
As these are expanding tables feeding from the internet I don't think copy and paste into one column will work (I'm not sure about this but I would prefer a formula to avoid any issues).
View 4 Replies
View Related
May 19, 2014
I have a large volume of data and i need to manage and organize somehow.
Example:
A B C D E
CHRIS AN204 2005 Apple Green
CHRIS AN204 2005 Apple Red
CHRIS AN205 2005 Apple Yellow
TOM AN204 2006 Apple Green
This should look like this
A B C D E
CHRIS AN204 2005 Apple Green, Red
CHRIS AN205 2005 Apple Yellow
TOM AN204 2006 Apple Green
I manage somehow to find a VBA code that will merge my rows, but it's not working as it should. It's losing data.
Also in a cell it can happen to have more than 255 characters.
View 1 Replies
View Related
Sep 1, 2008
After sorting and filtering rows with in a set range I will have several rows that are almost duplicates. This is normal and expected due to how the workbook is used. Among these rows also will be several single rows that are not duplicates. It is important that I combine any two duplicates into one row. Example:
CREATE TABLES LIKE BELOW?
ABC D E F G H I J K
1 NameA 0XX15930777PS101300PS9
2 NameA0XX15930777PS91200PS10
3 NameX1159XXP555FBX1545PS9
4 NameB0A1234P123PS101263PS9
5 NameB1A1234P123PS90512PS10
What I need is this end result:
CREATE TABLES LIKE BELOW?
ABC D E F G H I J K
1 NameA 0XX15930777PS91200PS10PS101300PS9
2 NameX1159XXP555FBX1545PS9
3 NameB1A1234P123PS90512PS10PS101263PS9
It’s important that the data in each column stay with in that same column. Also of course it needs to be on the same row with the same person (NameA and NameB). The Columns that would determine if it’s a duplicate are D and E –. I would need this to be preformed via macro or some easy way so that others will not have a hard time. It will be on a protected Shared Workbook with Excel 2003. I've enclosed a Sample. How can I sort these or accomplish this and maintain the data where it needs to be?
View 5 Replies
View Related
May 5, 2006
In the attached file (I'm sorry it is zipped, it was just too big), I gave you a snippet of my database. The actual one has 9000+ records. Over in Y4, you'll see the Sum of all the amounts (column X). Run the first macro, that is, Copy Dups, and you'll see it splits the item up by the numbers in column N. This works perfectly (or so it appears.) Then, run the Summary macro (the only other macro in there) and you will see that it pulls the Sums of each spreadsheet and places them on one nice overview page. The summary page. The only problem is, the total of the subtotals on the summary page do not match the total on the main (unadultered) page. I hope i am explaining this right. Somewhere in the macros, I am losing data from my spreadsheets so that the summary page is not equal to the un-macro'd data.
/scratches head
View 9 Replies
View Related
Oct 18, 2009
I have this file where i delete columns which are extra, in my real file most of the cells are formulas or links . Basically i need a macro which looks in row 4, and if it finds any zeros ( number 0 ) in the cell it deletes that whole column.
The zero is a indicator for me when i work on these files if it is needed or not. Included the file as an attachement.
View 2 Replies
View Related
Oct 12, 2007
I am currently using the following code to hide each row when there is no data between a certain column range. I need to add to this code so that it will also hide each column when there is no date between the row range.
Private Sub Worksheet_Activate()
Dim HiddenRow&, RowRange As Range, RowRangeValue&
ActiveWindow.DisplayZeros = False
Application. ScreenUpdating = False
For HiddenRow = FirstRow To LastRow
Set RowRange = Range(FirstCol & HiddenRow & _
":" & LastCol & HiddenRow)
RowRangeValue = Application.Sum(RowRange.Value)
If RowRangeValue <> 0 Then
'there's something in this row - don't hide
Rows(HiddenRow).EntireRow.Hidden = False
Else
'there's nothing in this row yet - hide it
Rows(HiddenRow).EntireRow.Hidden = True
End If
Next HiddenRow
Application.ScreenUpdating = True
End Sub
View 3 Replies
View Related
Dec 4, 2013
I have a data set that I'm trying to sort in order to be efficient for some of my team members.
Below is an example of the raw data and how I've currently got it sorted. I think my problem may be that I am trying to join a number with a string but I'm not positive.
Col A
123-45678-A-1
123-45678-A-10
123-45678-B-2
I need to eliminate the letter from the data, add a leading zero to all single digit numbers and sort ascendingly.
My first step is to split the data into columns using the "-" as a delimiter. I end up with 2 columns as shown below.
Col A
Col B
123-45678-
1
123-45678-
10
123-45678-
2
Next I add a leading zero to Col B. The assumption is there will never be more than 99 numbers, so I use the following code:
Columns("B:B").Select
Selection.NumberFormat = "00"
To produce:
Col A
Col B
123-45678-
01
123-45678-
10
123-45678-
02
Now all I need to do is rejoin these 2 columns before sorting. My current code is:
Sub Rejoin_Container_Number()
x = 1
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Do While Cells(x, 2).Value ""
Cells(x, 1).Value = Cells(x, 2).Value & Cells(x, 3).Value
[Code]...
As many have probably already guessed, this produces the following result:
Col A
123-45678-1
123-45678-10
123-45678-2
I'm looking for:
Col A
123-45678-01
123-45678-10
123-45678-02
**zeroes in BOLD for reference only, result does not need to be bold**
View 4 Replies
View Related
Jun 5, 2013
Collapsing function: I want to select cells that I want merged, and have them COLLAPSE into the first cell selected calls
Combining function: OR Select the cells I want merged, and allow me to pick a destination cell for the result COMBINE
I would like to add this functionality to all my spreadsheets in the future.
Excel-Forum-Data Collapsing sample.xls
View 1 Replies
View Related
Aug 31, 2009
Trying to create a macro that will add the date & time & initials (i.e 8/26/09 2:34 PM JOD) into the current cell.
I've found plenty of macro's that will do this but it ends up deleting any existing text within the cell. I need to be able to add it in the middle of a text string.
View 10 Replies
View Related
Jan 22, 2009
After scouring the entire OzGrid, I have found the following two macros that partly satisfy what I want to achieve. BTW, following two macros are executed on Sheet2 and I want to achieve the following:
On Worksheet_Activate, show columns that match the criteria value in Sheet1.D4 (Sheet1.D4 contains a dropdown list with about 6 text values). In addition to that, if Sheet1.D4 value is blank then show all columns. Right now, it successfully shows columns that match the D4 value but does not work if that D4 value is left blank, instead it hides all columns in range (C:CV). So in short, to the first macro, I need to add the criteria if D4 is blank, then keep the sheet intact and don’t hide anything, just show all columns.Once on that sheet after the Worksheet_Activate event has occurred, with the second macro “ToggleColumnsVisibility” following things need to happen. BTW, currently this macro is assigned to a button (from Forms Toolbar).If cell D4 has a value, then the button’s caption should read “Show All” and when that button is pressed, it should show all columns in the range (C:CV), and the button's caption needs to change to “Show Selected”. In “Show Selected” mode, when that button is pressed, it needs to show all the columns that match the D4 value.If cell D4 is left blank, then the button's caption should read "No Action" and when the button is pressed, it should not do anything but just show all columns.
As you will notice in the header, my experience with Excel is very limited, so detailed instructions will be greatly appreciated. I am also hoping that proposed solution uses some of the efficient/effective ways of using loops such as described below (example taken from this website from this link http://www.ozgrid.com/VBA/SpeedingUpVBACode.htm)
Sub TrueOrFalseFaster()
Dim bYesNo As Boolean
Dim i As Integer
bYesNo = (i = 5)
MsgBox bYesNo
End Sub
Sub ToggleTrueOrFalseFaster()
Dim bYesNo As Boolean
bYesNo = Not bYesNo
MsgBox bYesNo
End Sub .........
View 9 Replies
View Related
May 4, 2014
I have column A and it has 1000 rows, every row has a number in it, from 5000 to 5200, meaning that some numbers are presented multiple times in column A.
I need to lose repetitions, so every number is in the the table only one time and then I need to convert this one long column into, for example, 9 columns, so there's no wasting of space and have only one column in every page, if printed out.
View 5 Replies
View Related
Sep 20, 2013
How to convert "Excel table" to a range without loosing data connection to access?
View 2 Replies
View Related
Mar 31, 2014
I have two columns, which have different length and in which there can be three types of data:
The data also in the first and the second column, so it is an old data.Second is, that the data is in the first column, but not in the second, so it is old, but it was solved.The third type is, when the data is in the second column, but not iin the first, so it is new data.
My task is to regularly update the list (so I have to merge the new and old columns), to see in which conditions the data is, but not to delete any of them (only the recurring, so if it is old, then it must not be listed two times).
View 1 Replies
View Related
Feb 7, 2009
I have a need to get the data from columns A and B and transfer to C but one line from A and second line from B and this successively until the end of A and B. They will have the same number of lines.
View 3 Replies
View Related
Jan 26, 2013
How I can merge two columns together and keep the data in both columns?
I have an address issue when the data was converted to excel it put the numbers part of the address in column "C" and the street name in column "D".
View 2 Replies
View Related
Sep 12, 2008
i am trying to create a macro that merges two columns in excel.
View 9 Replies
View Related
Nov 29, 2012
I have a long row of data with words/numbers in each cell. Whenever I see a cell starting with W, I want to add up the value 2 cells to the right of that cell starting with W.
For example, if these following 9 cells in the same row read W1, 90, 100, M2, 90, 100, W2, 90, 40, whenever the cell starts with W, I want to sum up the value 2 cells to the right of that cell starting with W. In this case, I am adding up the values 2 cells to the right of W1 and W2, which is 100 + 40 = 140. How can I do that?
View 2 Replies
View Related
Feb 15, 2014
I'm currently working with the "Original"sheet shown on the attached file. From this, you will see that there is generic information contained in columns A:D then columns containing a month date and the associated FTE figure.
What I'm trying to do is as follows:
-Insert two columns after the "Investment Role" column, with column headers of "Period" and "FTE"
-Then, for each month column for each record, create a new row one under the other, copy the values in columns A:D and paste them into the newly created row,
-Then move the Date value for each month and the associated FTE figure and put these in the "Period" and "FTE"columns.
I've attached a file showing the 'Original' dataset and 'Desired Outcome' to look at.
Although the values in all of the fields may change month on month, and the number of rows may change, the number of columns will remain the same.
Merge Columns Test.xls‎
View 5 Replies
View Related
Jul 9, 2009
I'd like to perform a merge of value between columns D and E.
So if D9's value = 2 and E9's value = 15
then the result will be
E9=215
I've tried the following but I haven't gotten it to work.
View 7 Replies
View Related
Mar 17, 2009
on the "all data" sheet, there are two rows that have a Y for file missing - these are to be marked, so that they may be focused on finding their file
currently, i am doing as such and then filtering by that column to print out a list, and would like a simplified solution (populate sheet "missing") with just those rows who have missing files - so that another user may easily view such data without having to fondle around with the master list
View 2 Replies
View Related
Jul 23, 2014
I have two columns that are the same field, both Middle Name. The first column does not have every single row filled and the second column has every row the first column does not have and vice versa. I want to merge them to one filled column.
View 2 Replies
View Related
Aug 14, 2009
I have a worksheet with 10000 plus entries in ten columns From K to T. I wish to have a macro with Concatenate function to merge certain Columns from these ten columns, in one column with help of input boxes which may ask inputs, about range (from and to ), and number of digits to concatenate in the required column. I use Excel 2003 XP in work but an example is 2007 attached.
View 5 Replies
View Related