Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Autofill down over blank cells until new data, and repeat.

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Autofill down over blank cells until new data, and repeat.

On 8 Sep., 22:07, Brian Albright 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't autofill cells in a column if blank cells in between SJ Excel Worksheet Functions 1 May 4th 08 01:27 AM
Need macro to autofill when there are blank cells Christy Excel Programming 2 July 6th 06 08:30 PM
Use Autofill in a macro to fill blank cells until next text - goldyjk Excel Programming 1 June 14th 05 06:40 PM
Autofill data in specific blank cells Mr. G. Excel Worksheet Functions 0 April 22nd 05 09:41 PM
Use Autofill in a macro to fill blank cells until next text - Bernie Deitrick Excel Programming 0 February 18th 05 06:45 PM


All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"