Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

dump data into new

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » DUMP DATA INTO NEW COLUMN FROM SEARCH OF OTHER COLUMN

DUMP DATA INTO NEW COLUMN FROM SEARCH OF OTHER COLUMN

ResolvedVersion 2010

Adrian has attended:
Excel VBA Introduction course
Excel VBA Intermediate course
Excel Intermediate course

DUMP DATA INTO NEW COLUMN FROM SEARCH OF OTHER COLUMN

Hi

I have a column (lets say A:A) where cells either contains the letter D or is blank. For all the cells that are blank, I want it to dump the corresponding cell entry in another column ie if A5 was blank, then I want in column C to show data in Cell B5. However, I want column C to be come a list ie the Data from column B is in cells C1, C2, C3 etc. Example below

Column A Column B Column C
D ABC123 JKU354
D ADF789 POP898
JKU354 WER795
D JRE989
POP898
WER795
D YIO809

RE: DUMP DATA INTO NEW COLUMN FROM SEARCH OF OTHER COLUMN

Hi Adrian

Interesting question! Here's one possible way but only works if there are no gaps in the data in the B column. I've called the procedure ListBlank


Sub ListBlank()
' Counter keeps track of the blank cells in col A
Dim Counter As Integer Range("B1").Select

Do Until ActiveCell = ""
If ActiveCell.Offset(0, -1) = "" Then
Counter = Counter + 1
Cells(Counter, 3) = ActiveCell 'update C column if blank
End If
ActiveCell.Offset(1, 0).Select ' move down one cell
Loop

Hope that does the trick.

Doug
Best STL


End Sub

Fri 31 Oct 2014: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Recently used file list

Under the File menu, you may find a list of files at the bottom of the menu. These files represent the most recently used Excel spreadsheets. This file list provides a quick way for you to access your files.

You can disable the file list feature of Excel. This is done by

1. Choose Tools > Options menu. You will see the Options dialog box.
2. Ensure the General tab is selected.
3. Make sure the Recently Used File List check box is cleared.
4. Click on OK.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.