PC Review


Reply
Thread Tools Rate Thread

Autofill down over blank cells until new data, and repeat.

 
 
Brian Albright
Guest
Posts: n/a
 
      8th Sep 2008
Hey everyone,

I searched around a bit but couldn't find an answer to what I'm trying
to do exactly, so maybe I can get a bit of help here?

I have a list of data that looks something like this:

Month Mgr Item
January Rob 4
- - 5
- Ted 3
- - 4
February Alex 3
- - 4
- - 5
- Rob 7
- - 9
March Ted 3
- - 4
- - 6

where '-' represents a blank cell.

In order to put this data into a pivot table, it seems I need to fill
in all the data for all the dashes with redundant data. I'd need to
fill down January 3 times, February twice, and so on. I would also
have to fill the names down to match the data.

Is there an easy way or a macro I can write that will fill the cells
down until it reaches the next data cell, and then continue to fill
that down with the new data and so on to fill the table in order to
put it into a Pivot table?

Thanks in advance,
Brian
 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      8th Sep 2008
On 8 Sep., 22:07, Brian Albright <Albright.Br...@gmail.com> wrote:
> Hey everyone,
>
> I searched around a bit but couldn't find an answer to what I'm trying
> to do exactly, so maybe I can get a bit of help here?
>
> I have a list of data that looks something like this:
>
> Month * * *Mgr * * Item
> January * *Rob * *4
> - * * * * * * *- * * * * 5
> - * * * * * * *Ted * * 3
> - * * * * * * *- * * * * 4
> February *Alex * *3
> - * * * * * * *- * * * * 4
> - * * * * * * *- * * * * 5
> - * * * * * * Rob * * 7
> - * * * * * * - * * * * *9
> March * * Ted * * *3
> - * * * * * * - * * * * *4
> - * * * * * * - * * * * *6
>
> where '-' represents a blank cell.
>
> In order to put this data into a pivot table, it seems I need to fill
> in all the data for all the dashes with redundant data. *I'd need to
> fill down January 3 times, February twice, and so on. *I would also
> have to fill the names down to match the data.
>
> Is there an easy way or a macro I can write that will fill the cells
> down until it reaches the next data cell, and then continue to fill
> that down with the new data and so on to fill the table in order to
> put it into a Pivot table?
>
> Thanks in advance,
> Brian


Hi Brian

With your table in columns A:C and Headings in row 1, this should fill
in the redundant data.

Sub FillIn()
LastRow = Range("C1").End(xlDown).Row

For r = 3 To LastRow
If Cells(r, 1).Value = "" Then Cells(r, 1).Value = Cells(r - 1,
1).Value
If Cells(r, 2).Value = "" Then Cells(r, 2).Value = Cells(r - 1,
2).Value
Next
End Sub

Regards,
Per
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't autofill cells in a column if blank cells in between SJ Microsoft Excel Worksheet Functions 1 4th May 2008 01:27 AM
How to Autofill empty cells in a column by previous data found =?Utf-8?B?RXJzbnQ=?= Microsoft Access 3 31st Aug 2006 05:23 AM
Need macro to autofill when there are blank cells =?Utf-8?B?Q2hyaXN0eQ==?= Microsoft Excel Programming 2 6th Jul 2006 08:30 PM
Use Autofill in a macro to fill blank cells until next text - URGE =?Utf-8?B?bWFyaWthMTk4MQ==?= Microsoft Excel Programming 6 14th Jun 2005 06:40 PM
Autofill data in specific blank cells =?Utf-8?B?TXIuIEcu?= Microsoft Excel Worksheet Functions 0 22nd Apr 2005 09:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:10 AM.