|
-
Jun 14th, 2006, 12:01 PM
#1
Thread Starter
New Member
excel merge cells with VBA macro
Can anyone help me with a VBA macro to merge two non-blank cells into a third (blank) cell with a space between the text data? For example, part numbers (12345) in column A or B, Description (XYZ) in column C. The output should be in column D (12345 XYZ). Note: My data file is created from a data base that is not consitent in terms of data entry for column A and B. The result is sometimes the part number is in A and sometimes in B. I need to import the column D (output) data into another database, my peachtree accounting software. Option: I could add the text from A or B into C and not use D if that is easier.
Thanks in advance for any help.
-
Jun 14th, 2006, 01:18 PM
#2
Re: excel merge cells with VBA macro
Assuming that your data starts in cell A2, i.e Row 1 contains headers, then copy this formula into cell D2 and fill it down.
Code:
=IF(ISBLANK(A2),B2,A2)&" "&C2
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Jun 25th, 2006, 11:49 PM
#3
Thread Starter
New Member
Re: excel merge cells with VBA macro [Resolved]
DKenny sorry for my late reply, thanks, this works!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|