Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Automation Help
Message
 
À
02/04/2004 03:34:48
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00891618
Message ID:
00891755
Vues:
29
Excellent! Much thanks!

>>I've recorded an Excel macro which I'm trying to duplicate from VFP using Automation. I've got it all working except one thing:
>>
>>Selection.Insert Shift:=xlDown
>>
>>Here is the whole macro for reference:
>>
>>
>>Sub create_new_week()
>>'
>>' create_new_week Macro
>>' Macro recorded 10/7/2003
>>'
>>    Range(Selection, Selection.End(xlToRight)).Select
>>    Range("A3:H8").Select
>>    Selection.Copy
>>    Selection.Insert Shift:=xlDown
>>    Range("B4:H6").Select
>>    Selection.ClearContents
>>End Sub
>>
>>
>>How can I automate Selection.Insert Shift:=xlDown?
>>
>>TIA
>
>Michael,
>This is exact copy of macro (dropping unncessary first line) :
>
>#Define xlShiftDown	-4121
>With ox.ActiveWorkBook.ActiveSheet
>    .Range("A3:H8").Select
>    .Application.Selection.Copy
>    .Application.Selection.Insert(xlShiftDown)
>   .Range("B4:H6").Select
>   .Application.Selection.ClearContents
>Endwith
>
>And this is alternative (unlike macro you don;t need to work with Selection)
>
>#Define xlShiftDown	-4121
>With ox.ActiveWorkBook.ActiveSheet
>    .Range("A3:H8").Copy
>    .Range("A3:H8").Insert(xlShiftDown)
>    .Range("B4:H6").ClearContents
>*    .Range("B4:H6").Select && If you want to have it selected as macro does
>Endwith
>
Cetin
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform