Jump to content
Sign in to follow this  
MaoMao

Help Excel function

Recommended Posts

MaoMao

Hello,

Searched the site for $oExcel.Activesheet.PasteSpecial.

Only able to found example of paste copied content.

Need to copy formular of a new Excel column. Please help.

$oExcel.Sheets("ExcelBook1").Select

$oExcel.Activesheet.Columns(3).copy

$oExcel.Activesheet.Columns(4).Select

$oExcel.Activesheet.PasteSpecial(Foumulars) ; ???? (Foumulars) not working

Found Example:

$oExcel.ActiveSheet.Cells(1,1).PasteSpecial(0xFFFFEFBD);Paste the copied content from the first Workbook into the second Workbook

What is the code for $oExcel.PasteSpecial(?????)?

Edited by MaoMao

Share this post


Link to post
Share on other sites
saywell

Would these, from the excel UDF, be what you're looking for?

William

_ExcelReadCell

_ExcelWriteFormula

Share this post


Link to post
Share on other sites
MaoMao

Thanks. May force to do it cell by cell use ExcelWriteFormula if PasteSpecial do not work.

Trying to find easy way if there are code for PasteSpecial(Foumulars)

$oExcel.Activesheet.PasteSpecial(?????) ; ????? (Foumulars) code not found.

Anyone know if the $oExcel.Activesheet.PasteSpecial(Formulars) works or the code of PasteFormulars for PasteSpecial(?????)?

Share this post


Link to post
Share on other sites
saywell

I haven't used it, but it looks like you can specify a range for _ExcelWriteFormula .

William

Share this post


Link to post
Share on other sites
MaoMao

_ExcelWriteFormula seems a powerful function. It could be a good way to try.

The worksheet now working at got different formulars for each row and got data different for each column.

Used to do it manually to copy high light the column and then drag the formular to the rest of the columns.

(or pastespecial special the formula to the rest of columns.

It seems there is no lazy way to do it. Just need more Autoit program.

Share this post


Link to post
Share on other sites
water

Information about PasteSpecial can be found on MSDN.

If I undertstand your original post you want to copy the formulas of column 3 to column 4?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Juvigy

$oExcel.Range("A2").Copy

$oExcel.Range("A3").Select

$oExcel.Selection.PasteSpecial(-4123,-4142,False,False)

Share this post


Link to post
Share on other sites
lorenkinzel

It seems there is no lazy way to do it.

The Excel macro recorder serves my laziness really well.

It does seem to work best if you record short, choppy macros rather than 1 multi-function macro.

That makes it easier to translate the code to AutoIT.

Share this post


Link to post
Share on other sites
Reg2Post

$oExcel.Sheets("ExcelBook1").Select

$oExcel.Activesheet.Columns(3).copy

$oExcel.Activesheet.Columns(4).Select

$oExcel.Activesheet.PasteSpecial(Foumulars) ; ???? (Foumulars) not working

Try:

$oExcel.ActiveSheet.Columns("C:C").Copy

$oExcel.ActiveSheet.Columns("D:D").Select

$oExcel.Selection.PasteSpecial(0xFFFFEFBD,Default,Default,Default)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×