Re: Debug Q
- From: "John" <john@xxxxxxxxxx>
- Date: Tue, 26 Apr 2005 07:11:34 +0100
Don
Using just your code the exact error appearing is "This operation requires
the merged cells to be identiacally sized", the one I paraphrased below,
thats why I tended to copy, then paste / special with the target ***.
Going in to debug the following line is highlighted
".Range("a1").PasteSpecial Paste:=xlPasteValues"
Thanks
"Don Guillett" <donaldb@xxxxxxx> wrote in message
news:O4g9TOeSFHA.576@xxxxxxxxxxxxxxxxxxxxxxx
> try this from anywhere in the workbook. No need to unhide.
>
> Sub copypastetohidden***()
> With Sheets("destinationsheet")
> .Unprotect
> Sheets("sourcesheet").Cells.Copy
> .Range("a1").PasteSpecial Paste:=xlPasteAll
> .Range("a1").PasteSpecial Paste:=xlPasteValues
> .Protect
> End With
> End Sub
>
> --
> Don Guillett
> SalesAid Software
> donaldb@xxxxxxx
> "John" <r.@xxxxxxxxxxxxxxx> wrote in message
> news:widbe.52212$Z14.42310@xxxxxxxxxxxxxxxxx
>> Thanks Don
>>
>> What I find when I just select an area is that I get the message along
>> the
>> lines of "your merged cells are not the same size". So I tend to
> copy/paste
>> and then copy / paste special values (as I don't want links or formuls in
> my
>> target work***). What I'm trying to do is copy all f "Figures" to ***
>> "E-Figures", nothing more complicated than that. *** E-Figures was
>> originally hidden
>>
>>
>> "Don Guillett" <donaldb@xxxxxxx> wrote in message
>> news:ewpVJEbSFHA.3288@xxxxxxxxxxxxxxxxxxxxxxx
>> > Not quite sure what you are trying to do but hidden doesn't matter and
> you
>> > don't have to select. This will from anywhere copy d1 to sheet1!d12
>> >
>> > Sub copytoprotected***()
>> > With Sheets("destinationsheet")
>> > .Unprotect
>> > Sheets("sourcesheet").Range("d1").Copy .Range("d12")
>> > .Protect
>> > End With
>> > End Sub
>> >
>> > Repost with your successful macro for all to see
>> >
>> > --
>> > Don Guillett
>> > SalesAid Software
>> > donaldb@xxxxxxx
>> > "John" <john@xxxxxxxxxx> wrote in message
>> > news:177be.52197$Z14.42284@xxxxxxxxxxxxxxxxx
>> >> I have the following code that enters Debug at the line that says
>> >> "Active***.Paste". The target *** i.e. E-Figures is not protected,
>> >> can
>> >> anyone see any reason for this? It states in the dialogue box "Paste
>> > method
>> >> of work*** class failed"
>> >>
>> >> Thanks
>> >>
>> >>
>> >>
>> >> Sub Generate_Reports()
>> >>
>> >> Sheets("Figures").Select
>> >> Active***.Unprotect Password:="enter"
>> >>
>> >> Cells.Select
>> >> Selection.Copy
>> >> Range("A1").Select
>> >> Sheets("E-Figures").Visible = True
>> >> Sheets("E-Figures").Select
>> >> Active***.Unprotect Password:="enter"
>> >> Sheets("E-Figures").Select
>> >> Range("A1").Select
>> >> Active***.Paste
>> >> Cells.Select
>> >> Selection.Copy
>> >> Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
>> > SkipBlanks:=
>> >> _
>> >> False, Transpose:=False
>> >> Range("A1").Select
>> >> Application.CutCopyMode = False
>> >> ActiveWindow.SelectedSheets.Visible = False
>> >> Sheets("Home").Select
>> >> Range("A1").Select
>> >>
>> >> Mail_Reports
>> >> End Sub
>> >>
>> >>
>> >
>> >
>>
>>
>
>
.
- Follow-Ups:
- Re: Debug Q
- From: John
- Re: Debug Q
- References:
- Debug Q
- From: John
- Re: Debug Q
- From: Don Guillett
- Re: Debug Q
- From: John
- Re: Debug Q
- From: Don Guillett
- Debug Q
- Prev by Date: Getting the longest lengh in range of cells
- Next by Date: Re: Insert different values in a formula
- Previous by thread: Re: Debug Q
- Next by thread: Re: Debug Q
- Index(es):