Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto filling a select # of rows

I got the script below from a magazine but the second to
the last line is giving me an error. How can I fix it?

Thanks.

Dim fillRange As Range

Dim numRows As Integer, numCols As Integer

numRows = InputBox("How many rows to fill?", "Do an
extended fill")

numCols = InputBox("How many columns to fill?", "Do an
estended fill")

Set fillRange = ActiveCell.Range(Cells(1, 1), Cells
(numRows, numCols))

Selection.AutoFill Destination:=fillRange,
Type:=xlFillDefault

fillRange.Select

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Auto filling a select # of rows

Hi,

The macro works fine. The Autofill method requires more than one cell to be
selected to determine the fill values for the target cells, so make sure you
select more than one row as the source for filling down and more than one
column for filling across. The fill range starts from the top left source
cell.

Cheers


"M Rodas" wrote in message
...
I got the script below from a magazine but the second to
the last line is giving me an error. How can I fix it?

Thanks.

Dim fillRange As Range

Dim numRows As Integer, numCols As Integer

numRows = InputBox("How many rows to fill?", "Do an
extended fill")

numCols = InputBox("How many columns to fill?", "Do an
estended fill")

Set fillRange = ActiveCell.Range(Cells(1, 1), Cells
(numRows, numCols))

Selection.AutoFill Destination:=fillRange,
Type:=xlFillDefault

fillRange.Select



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.614 / Virus Database: 393 - Release Date: 5/03/2004


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
"Cross"-Auto filling: consecutive columns into rows AndreasW Excel Worksheet Functions 1 October 19th 09 01:46 PM
Auto Filling ckane Excel Worksheet Functions 1 May 3rd 07 09:48 PM
Auto filling a row phil2006 Excel Discussion (Misc queries) 2 July 31st 06 12:33 PM
Auto Protecting cells & auto filling date ccarmock Excel Discussion (Misc queries) 7 September 30th 05 09:21 PM
auto filling columns from rows Ken Excel Discussion (Misc queries) 2 February 23rd 05 09:49 AM


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