Solved

excel vbs: fill column B with values of column A if B is empty

Posted on 2011-02-11
3
294 Views
Last Modified: 2012-05-11
Dear Experts,

In an excel sheet I have values in seperate columns that need combined in that sense that if the cell in column B is empty the value of columnA 1 is filled in.
 I need to end up with 1 column ...

So that this:
12/03/2011 8:00      12/03/2011 18:00
12/03/2011 8:00      12/03/2011 18:00
12/03/2011 8:00      
12/03/2011 8:00      
12/03/2011 8:00      
12/03/2011 8:00      
12/03/2011 8:00      
12/03/2011 8:00      
12/03/2011 8:00      12/03/2011 18:01
12/03/2011 1:00      
12/03/2011 1:00      
12/03/2011 1:00      
12/03/2011 1:00      
12/03/2011 1:00      
12/03/2011 1:00      
12/03/2011 1:00      
12/03/2011 8:00      12/03/2011 16:15


Becomes that:

12/03/2011 8:00      12/03/2011 18:00
12/03/2011 8:00      12/03/2011 18:00
12/03/2011 8:00      12/03/2011 8:00
12/03/2011 8:00      12/03/2011 8:00
12/03/2011 8:00      12/03/2011 8:00
12/03/2011 8:00      12/03/2011 8:00
12/03/2011 8:00      12/03/2011 8:00
12/03/2011 8:00      12/03/2011 8:00
12/03/2011 8:00      12/03/2011 18:01
12/03/2011 1:00      12/03/2011 1:00
12/03/2011 1:00      12/03/2011 1:00
12/03/2011 1:00      12/03/2011 1:00
12/03/2011 1:00      12/03/2011 1:00
12/03/2011 1:00      12/03/2011 1:00
12/03/2011 1:00      12/03/2011 1:00
12/03/2011 1:00      12/03/2011 1:00
12/03/2011 8:00      12/03/2011 16:15


Please have a look into this.
Many thanks in advance.
0
Comment
Question by:Watnog
  • 2
3 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34871271
You could use another column with formulas:
=if(B1="",A1,B1)
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 34871277
Or select column B, press f5, click the Special button, then choose Blanks from the list and press OK. Now press = then the left arrow then Ctrl+Enter.
0
 

Author Closing Comment

by:Watnog
ID: 34871394
Excellent.
Thank you.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA: compare column rows by rows based on a config sheet v3 11 27
Excel cell formatting 5 27
Excel Question 17 15
Manipulate Range in Excel VBA 6 21
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now