Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Filling in the blanks methods?

I have a data extract from a crosstab and now on a regular basis need
to fill in the blanks to apply a suitable filter.

Below I've included an example.

A1: 1
A2:
A3:
A4:
A5:
A6:
A7: 2
A8:
A9:
A10:
A11:
A12:
A13:
A14 3

This will continue until 6 is reached and then I will need something
(xlUp?) to obtain the LastRow to stop filling down to 65536.

The ranges are not static and will vary. I've attempted FillDown but
I've come across issues keeping the ranges flexible.

THe data is typically pasted into A6, but that is about all that is
rigid from a point of view of using a suitable ActiveCell range.

A6 is where 1

The gap from where "1", is typically in A6, yet the location for "2"
could be anywhere below , e.g. in A7, A9 , A20 etc.

After A6 the cells below are blank until there is a value of 2 in
whichever cell it is.

However If(IsBlank) works within Excel via the addition of a column
yet I wish to "hardwire" this in VB. Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Filling in the blanks methods?

Try this

Sub fill()

LastRow = ActiveSheet.Cells. _
SpecialCells(xlCellTypeLastCell).Row
'find first data
FirstRow = 1
Do While Range("A" & FirstRow) = ""
FirstRow = FirstRow + 1
Loop
Copydata = Range("A" & FirstRow)

For RowCount = (FirstRow + 1) To LastRow
If Range("A" & RowCount) = "" Then
Range("A" & RowCount) = Copydata
Else
Copydata = Range("A" & RowCount)
End If
Next RowCount
End Sub
"Simon" wrote:

I have a data extract from a crosstab and now on a regular basis need
to fill in the blanks to apply a suitable filter.

Below I've included an example.

A1: 1
A2:
A3:
A4:
A5:
A6:
A7: 2
A8:
A9:
A10:
A11:
A12:
A13:
A14 3

This will continue until 6 is reached and then I will need something
(xlUp?) to obtain the LastRow to stop filling down to 65536.

The ranges are not static and will vary. I've attempted FillDown but
I've come across issues keeping the ranges flexible.

THe data is typically pasted into A6, but that is about all that is
rigid from a point of view of using a suitable ActiveCell range.

A6 is where 1

The gap from where "1", is typically in A6, yet the location for "2"
could be anywhere below , e.g. in A7, A9 , A20 etc.

After A6 the cells below are blank until there is a value of 2 in
whichever cell it is.

However If(IsBlank) works within Excel via the addition of a column
yet I wish to "hardwire" this in VB. Any suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Filling in the blanks methods?

Sub FillData()
With ActiveSheet
Set r = Intersect(.Columns(1), .UsedRange)
End With
Set r1 = r.SpecialCells(xlBlanks)
r1.Formula = "=A1"
r.Copy
r.PasteSpecial xlValues
End Sub

--
Regards,
Tom Ogilvy


"Simon" wrote:

I have a data extract from a crosstab and now on a regular basis need
to fill in the blanks to apply a suitable filter.

Below I've included an example.

A1: 1
A2:
A3:
A4:
A5:
A6:
A7: 2
A8:
A9:
A10:
A11:
A12:
A13:
A14 3

This will continue until 6 is reached and then I will need something
(xlUp?) to obtain the LastRow to stop filling down to 65536.

The ranges are not static and will vary. I've attempted FillDown but
I've come across issues keeping the ranges flexible.

THe data is typically pasted into A6, but that is about all that is
rigid from a point of view of using a suitable ActiveCell range.

A6 is where 1

The gap from where "1", is typically in A6, yet the location for "2"
could be anywhere below , e.g. in A7, A9 , A20 etc.

After A6 the cells below are blank until there is a value of 2 in
whichever cell it is.

However If(IsBlank) works within Excel via the addition of a column
yet I wish to "hardwire" this in VB. Any suggestions?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Filling in the blanks methods?

Debra Dalgleish has manual and mechanized suggestions he
http://contextures.com/xlDataEntry02.html

If it's not part of a larger routine, I'd do it manually. I find it quicker
than finding the macro and running it.

The manual method in video:
http://www.contextures.com/xlVideos01.html#FillBlanks


Simon wrote:

I have a data extract from a crosstab and now on a regular basis need
to fill in the blanks to apply a suitable filter.

Below I've included an example.

A1: 1
A2:
A3:
A4:
A5:
A6:
A7: 2
A8:
A9:
A10:
A11:
A12:
A13:
A14 3

This will continue until 6 is reached and then I will need something
(xlUp?) to obtain the LastRow to stop filling down to 65536.

The ranges are not static and will vary. I've attempted FillDown but
I've come across issues keeping the ranges flexible.

THe data is typically pasted into A6, but that is about all that is
rigid from a point of view of using a suitable ActiveCell range.

A6 is where 1

The gap from where "1", is typically in A6, yet the location for "2"
could be anywhere below , e.g. in A7, A9 , A20 etc.

After A6 the cells below are blank until there is a value of 2 in
whichever cell it is.

However If(IsBlank) works within Excel via the addition of a column
yet I wish to "hardwire" this in VB. Any suggestions?


--

Dave Peterson
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
Filling in blanks PAF Excel Discussion (Misc queries) 3 March 3rd 09 04:07 PM
Removing blanks / sorting - common methods not applicable Dark_Templar Excel Discussion (Misc queries) 1 May 26th 06 02:54 AM
End and Sort methods adding blanks LabElf Excel Programming 2 September 7th 05 01:08 AM
Access - Filling Blanks wal50 Excel Worksheet Functions 1 November 30th 04 06:45 PM
Filling in blanks. S. Kissing Excel Worksheet Functions 2 November 24th 04 09:29 PM


All times are GMT +1. The time now is 04:12 PM.

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

About Us

"It's about Microsoft Excel"