Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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!) |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofill range class failure
Susan,
Reference a post in some other thread which I have lost track of, but stumbled on your post outside the thread, if you want me to look at something, send it to me directly -- 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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofill method of range class failed | Excel Discussion (Misc queries) | |||
autofill method of range class failed | Excel Programming | |||
Autofill method of Range class failed | Excel Programming | |||
Autofill method of range class failed - sometimes | Excel Programming | |||
Select method of Range class failure | Excel Programming |