Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default autofill column data

hi all
am having no joy trying to write a vba macro that will scan column F if it
finds something it autofills that data down until the next piece of data
then autofill down that data this needs to be repeated until bottom of sheet
which is row 45,656( hence the need to use vba).
thanks in advance



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default autofill column data

Assuming you don't already have formulas in column F

actually, you can select column F and do

edit=goto=special and select Blanks

assume the first blank cell selected is F3

go to the formula bar and put in the formula

=F2 (the cell above the first selected/blank cell)

then do Ctrl+enter rather than Enter

This will fill all your "holes".

Now select Column F and do Edit=Copy, then Edit=PasteSpecial and select
Values. this will replace the formulas with the hard coded
Values.

in code
dim rng as Range, rng1 as Range
On error resume Next
set rng = Columns(6).SpecialCells(xlBlanks)
On error goto 0
if not rng is nothing then
rng.Formula = "=" & rng(1).offset(-1,0).Address(0,0)
set rng1 = Range(rng(1),rng(1).End(xldown))
rng1.Formula = rng1.Value
End If


--
Regards,
Tom Ogilvy


"ALAN EMERY" wrote in message
...
hi all
am having no joy trying to write a vba macro that will scan column F if

it
finds something it autofills that data down until the next piece of data
then autofill down that data this needs to be repeated until bottom of

sheet
which is row 45,656( hence the need to use vba).
thanks in advance





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default autofill column data

thankyou
you have saved me many hours work
"Tom Ogilvy" wrote in message
...
Assuming you don't already have formulas in column F

actually, you can select column F and do

edit=goto=special and select Blanks

assume the first blank cell selected is F3

go to the formula bar and put in the formula

=F2 (the cell above the first selected/blank cell)

then do Ctrl+enter rather than Enter

This will fill all your "holes".

Now select Column F and do Edit=Copy, then Edit=PasteSpecial and select
Values. this will replace the formulas with the hard coded
Values.

in code
dim rng as Range, rng1 as Range
On error resume Next
set rng = Columns(6).SpecialCells(xlBlanks)
On error goto 0
if not rng is nothing then
rng.Formula = "=" & rng(1).offset(-1,0).Address(0,0)
set rng1 = Range(rng(1),rng(1).End(xldown))
rng1.Formula = rng1.Value
End If


--
Regards,
Tom Ogilvy


"ALAN EMERY" wrote in message
...
hi all
am having no joy trying to write a vba macro that will scan column F

if
it
finds something it autofills that data down until the next piece of data
then autofill down that data this needs to be repeated until bottom of

sheet
which is row 45,656( hence the need to use vba).
thanks in advance







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
Data Validation Drop down list to Autofill next column j8zel Excel Worksheet Functions 4 July 23rd 10 02:45 PM
Autofill column from data (code) in column next to it Matt Excel Worksheet Functions 4 April 24th 09 06:17 PM
How do I autofill data in a column? jimmiller17 Excel Discussion (Misc queries) 2 February 12th 08 11:05 AM
How to set the autofill options in a column of a input data table JKB Excel Discussion (Misc queries) 1 July 16th 05 03:39 PM
Macro that will autofill a column with data, up to the last row of data in previous c Max Velocity Excel Programming 4 November 27th 03 10:34 AM


All times are GMT +1. The time now is 05:53 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"