?
Solved

Excel: Automatically Fill Gaps Based on Cells Above

Posted on 2009-04-03
4
Medium Priority
?
1,105 Views
Last Modified: 2012-05-06
How do I automatically fill in the gaps in a column based on the values in the cell above.
Eg Cell A1 says "MR X", Cell A10 says "Mr Y" and Cell A20 says "Mr Z"
What is the macro that would automatically fill down to show the following ( I need a macro as Ithere is too much data to do a manual fill down). Thanks!

A1 Mr X
A2 Mr X
A3 Mr X
A4 Mr X
A5 Mr X
A6 Mr X
A7 Mr X
A8 Mr X
A9 Mr X
A10 Mr Y
A11 Mr Y
etc etc etc etc...





0
Comment
Question by:doolinn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 59

Accepted Solution

by:
Saurabh Singh Teotia earned 2000 total points
ID: 24061418
Just follow these steps, You will be able to do what you are looking for...
  • Press F5  and then press special and hit ok
  • Hit Blanks and hit ok which will select the blank cells only.
  • Then in on of the blank sell do a reference to the cell above and enter it by ctrl+enter
This will show data in all the cells automatically which will have the fomrula in it.
Saurabh...
0
 
LVL 15

Expert Comment

by:yuk99
ID: 24061507
You can use this macro if your column is large.
Sub FillGaps()
If Selection.Cells(1, 1) = "" Then
    MsgBox "First cell is empty!", vbCritical
Exit Sub
End If
For Each c In Selection
    If c.Value = "" Then
        c.Value = c.Offset(-1, 0).Value
    End If
Next
End Sub

Open in new window

0
 
LVL 15

Expert Comment

by:yuk99
ID: 24061659
saurabh726,
Your solution is cool. I didn't know about it.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

762 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