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 on selection


Hi all,

Trying to use AutoFill on a selected range instead of a hardcoded
range. Ie: if i have a formula in B1,
then i select B1 and highlight a range. I want the formula copied as
progressive into the range.
Trying stuff like this with no joy.

Sub FillTest()
With Selection
'.AutoFill Destination = fillRange
'.AutoFill (Destination = fillRange)
'SourceRange.AutoFill Destination:=fillRange
End With
End Sub

Sub FillTest()
Selection.AutoFill Destination:=ActiveCell.Range("Want Selected range
here"), _
Type:=xlFillDefault
End Sub


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=519047

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default AutoFill on selection

Does progressive mean that you want to fill the cells row by row (one by one)?

Or you just want to fill that formula into a larger range--say based on the last
cell used in column A?

Option Explicit
Sub testme()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("B1").AutoFill Destination:=.Range("B1:b" & LastRow)
End With
End Sub


Desert Piranha wrote:

Hi all,

Trying to use AutoFill on a selected range instead of a hardcoded
range. Ie: if i have a formula in B1,
then i select B1 and highlight a range. I want the formula copied as
progressive into the range.
Trying stuff like this with no joy.

Sub FillTest()
With Selection
'.AutoFill Destination = fillRange
'.AutoFill (Destination = fillRange)
'SourceRange.AutoFill Destination:=fillRange
End With
End Sub

Sub FillTest()
Selection.AutoFill Destination:=ActiveCell.Range("Want Selected range
here"), _
Type:=xlFillDefault
End Sub

--
Desert Piranha

------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=519047


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default AutoFill on selection


Hi Dave,

What you have here, does what i am doing, with the AutoFill,
except instead of hard coding the range i want to select the range.
like
..ActiveCell.AutoFill Destination:=.Range(Selection)

Thx
Dave
Dave Peterson Wrote:
Does progressive mean that you want to fill the cells row by row (one by
one)?

Or you just want to fill that formula into a larger range--say based on
the last
cell used in column A?

Option Explicit
Sub testme()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("B1").AutoFill Destination:=.Range("B1:b" & LastRow)
End With
End Sub


Desert Piranha wrote:

Hi all,

Trying to use AutoFill on a selected range instead of a hardcoded
range. Ie: if i have a formula in B1,
then i select B1 and highlight a range. I want the formula copied as
progressive into the range.
Trying stuff like this with no joy.

Sub FillTest()
With Selection
'.AutoFill Destination = fillRange
'.AutoFill (Destination = fillRange)
'SourceRange.AutoFill Destination:=fillRange
End With
End Sub

Sub FillTest()
Selection.AutoFill Destination:=ActiveCell.Range("Want Selected

range
here"), _
Type:=xlFillDefault
End Sub

--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=519047

--

Dave Peterson



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=519047

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default AutoFill on selection

So you have a selection of cells and you want to fill the top row down through
the selected area?

Option Explicit
Sub testme2()
Dim myRng As Range
Set myRng = Selection.Areas(1)
myRng.Rows(1).AutoFill Destination:=myRng
End Sub




Desert Piranha wrote:

Hi Dave,

What you have here, does what i am doing, with the AutoFill,
except instead of hard coding the range i want to select the range.
like
ActiveCell.AutoFill Destination:=.Range(Selection)

Thx
Dave
Dave Peterson Wrote:
Does progressive mean that you want to fill the cells row by row (one by
one)?

Or you just want to fill that formula into a larger range--say based on
the last
cell used in column A?

Option Explicit
Sub testme()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("B1").AutoFill Destination:=.Range("B1:b" & LastRow)
End With
End Sub


Desert Piranha wrote:

Hi all,

Trying to use AutoFill on a selected range instead of a hardcoded
range. Ie: if i have a formula in B1,
then i select B1 and highlight a range. I want the formula copied as
progressive into the range.
Trying stuff like this with no joy.

Sub FillTest()
With Selection
'.AutoFill Destination = fillRange
'.AutoFill (Destination = fillRange)
'SourceRange.AutoFill Destination:=fillRange
End With
End Sub

Sub FillTest()
Selection.AutoFill Destination:=ActiveCell.Range("Want Selected

range
here"), _
Type:=xlFillDefault
End Sub

--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=519047

--

Dave Peterson


--
Desert Piranha

------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=519047


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default AutoFill on selection


Hi Dave,

Yep, Thats it. "Thank you Very Much Dave".

Thx
Dave
Dave Peterson Wrote:
So you have a selection of cells and you want to fill the top row down
through
the selected area?

Option Explicit
Sub testme2()
Dim myRng As Range
Set myRng = Selection.Areas(1)
myRng.Rows(1).AutoFill Destination:=myRng
End Sub




Desert Piranha wrote:

Hi Dave,

What you have here, does what i am doing, with the AutoFill,
except instead of hard coding the range i want to select the range.
like
ActiveCell.AutoFill Destination:=.Range(Selection)

Thx
Dave
Dave Peterson Wrote:
Does progressive mean that you want to fill the cells row by row

(one by
one)?

Or you just want to fill that formula into a larger range--say

based on
the last
cell used in column A?

Option Explicit
Sub testme()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("B1").AutoFill Destination:=.Range("B1:b" & LastRow)
End With
End Sub


Desert Piranha wrote:

Hi all,

Trying to use AutoFill on a selected range instead of a

hardcoded
range. Ie: if i have a formula in B1,
then i select B1 and highlight a range. I want the formula copied

as
progressive into the range.
Trying stuff like this with no joy.

Sub FillTest()
With Selection
'.AutoFill Destination = fillRange
'.AutoFill (Destination = fillRange)
'SourceRange.AutoFill Destination:=fillRange
End With
End Sub

Sub FillTest()
Selection.AutoFill Destination:=ActiveCell.Range("Want Selected
range
here"), _
Type:=xlFillDefault
End Sub

--
Desert Piranha



------------------------------------------------------------------------
Desert Piranha's Profile:
http://www.excelforum.com/member.php...o&userid=28934
View this thread:
http://www.excelforum.com/showthread...hreadid=519047

--

Dave Peterson


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=519047

--

Dave Peterson



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=519047



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default AutoFill on selection

Glad it works ok.

Desert Piranha wrote:

Hi Dave,

Yep, Thats it. "Thank you Very Much Dave".

Thx
Dave
Dave Peterson Wrote:
So you have a selection of cells and you want to fill the top row down
through
the selected area?

Option Explicit
Sub testme2()
Dim myRng As Range
Set myRng = Selection.Areas(1)
myRng.Rows(1).AutoFill Destination:=myRng
End Sub




Desert Piranha wrote:

Hi Dave,

What you have here, does what i am doing, with the AutoFill,
except instead of hard coding the range i want to select the range.
like
ActiveCell.AutoFill Destination:=.Range(Selection)

Thx
Dave
Dave Peterson Wrote:
Does progressive mean that you want to fill the cells row by row

(one by
one)?

Or you just want to fill that formula into a larger range--say

based on
the last
cell used in column A?

Option Explicit
Sub testme()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("B1").AutoFill Destination:=.Range("B1:b" & LastRow)
End With
End Sub


Desert Piranha wrote:

Hi all,

Trying to use AutoFill on a selected range instead of a

hardcoded
range. Ie: if i have a formula in B1,
then i select B1 and highlight a range. I want the formula copied

as
progressive into the range.
Trying stuff like this with no joy.

Sub FillTest()
With Selection
'.AutoFill Destination = fillRange
'.AutoFill (Destination = fillRange)
'SourceRange.AutoFill Destination:=fillRange
End With
End Sub

Sub FillTest()
Selection.AutoFill Destination:=ActiveCell.Range("Want Selected
range
here"), _
Type:=xlFillDefault
End Sub

--
Desert Piranha



------------------------------------------------------------------------
Desert Piranha's Profile:
http://www.excelforum.com/member.php...o&userid=28934
View this thread:
http://www.excelforum.com/showthread...hreadid=519047

--

Dave Peterson

--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=519047

--

Dave Peterson


--
Desert Piranha

------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=519047


--

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
Selection AutoFill, Excel 2000 & 2003 James Cooper Excel Worksheet Functions 1 January 28th 07 07:51 AM
Function to store last row and use in autofill selection wayliff Excel Programming 2 December 26th 05 01:27 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George[_22_] Excel Programming 5 August 7th 04 10:33 AM


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