Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default autofill range class failure

i'm working on a larger macro & am having trouble w/this section
specifically. i've got it almost done but am getting a "run-time error
1004... autofill method of Range class failed" error........

Startcell.AutoFill Destination:=InsRngTmp, Type:=xlFillDefault

is there something wrong with this line? this is where it keeps
breaking.
"startcell" is the cell where the formula is entered, & then it's
supposed to autofill into "insrngtmp".

Dim Startcell As Range
Dim InsRngTmp As Range
Set InsRngTmp = Worksheets("xx").Range("d7:d100")
Set Startcell = Worksheets("xx").Range("d6")

any ideas would be appreciated.
thanks
susan (banging her head against the monitor)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default autofill range class failure

Susan( bhhatm)
The destination range must include the start range.
So change the destination range to include D6.
However, in most case you need at least two cells (values) in order to
autofill a range... maybe D5:D6 for the start range and D5:D100
for the destination range?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

"Susan" wrote in message oups.com...
i'm working on a larger macro & am having trouble w/this section
specifically. i've got it almost done but am getting a "run-time error
1004... autofill method of Range class failed" error........

Startcell.AutoFill Destination:=InsRngTmp, Type:=xlFillDefault

is there something wrong with this line? this is where it keeps
breaking.
"startcell" is the cell where the formula is entered, & then it's
supposed to autofill into "insrngtmp".

Dim Startcell As Range
Dim InsRngTmp As Range
Set InsRngTmp = Worksheets("xx").Range("d7:d100")
Set Startcell = Worksheets("xx").Range("d6")

any ideas would be appreciated.
thanks
susan (banging her head against the monitor)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default autofill range class failure

Set InsRngTmp = Worksheets("xx").Range("d7:d100")
should be

Set InsRngTmp = Worksheets("xx").Range("d6:d100")

the destination should include the original cell(s)

--
Regards,
Tom Ogilvy


"Susan" wrote:

i'm working on a larger macro & am having trouble w/this section
specifically. i've got it almost done but am getting a "run-time error
1004... autofill method of Range class failed" error........

Startcell.AutoFill Destination:=InsRngTmp, Type:=xlFillDefault

is there something wrong with this line? this is where it keeps
breaking.
"startcell" is the cell where the formula is entered, & then it's
supposed to autofill into "insrngtmp".

Dim Startcell As Range
Dim InsRngTmp As Range
Set InsRngTmp = Worksheets("xx").Range("d7:d100")
Set Startcell = Worksheets("xx").Range("d6")

any ideas would be appreciated.
thanks
susan (banging her head against the monitor)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default autofill range class failure

tom & jim:
i originally had it as including the starting cell, but when it
wouldn't work i figured that the starting cell couldn't be in the
range. that's why i changed it. but i think having the startcell be a
2-cell range made it work.
thank you!

now, while i have you, tom was trying to teach me to combine
commands.......
can you tell me why this works:
InsRange1.Copy
InsRange2.PasteSpecial Paste:=xlPasteAll

but this doesn't???
InsRange1.Copy("InsRange2").PasteSpecial Paste:=xlPasteAll

what am i doing wrong here? it gives me an error "unable to get the
copy property of the range class."
thanks
susan (gratefully feeling much better now!)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default autofill range class failure

when you paste special, you have to do the copy separately - just the way it
is.

--
Regards,
Tom Ogilvy


"Susan" wrote:

tom & jim:
i originally had it as including the starting cell, but when it
wouldn't work i figured that the starting cell couldn't be in the
range. that's why i changed it. but i think having the startcell be a
2-cell range made it work.
thank you!

now, while i have you, tom was trying to teach me to combine
commands.......
can you tell me why this works:
InsRange1.Copy
InsRange2.PasteSpecial Paste:=xlPasteAll

but this doesn't???
InsRange1.Copy("InsRange2").PasteSpecial Paste:=xlPasteAll

what am i doing wrong here? it gives me an error "unable to get the
copy property of the range class."
thanks
susan (gratefully feeling much better now!)




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
Autofill method of range class failed Appache Excel Discussion (Misc queries) 5 February 27th 08 03:37 PM
autofill method of range class failed phil2006[_16_] Excel Programming 2 June 28th 06 12:08 PM
Autofill method of Range class failed JJ \(UK\)[_2_] Excel Programming 2 August 14th 05 07:46 PM
Autofill method of range class failed - sometimes Intellihome Excel Programming 9 May 28th 05 01:21 PM
Select method of Range class failure Stuart[_5_] Excel Programming 3 February 24th 04 06:35 PM


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