Jump to content

read the columns of worksheet and set any data in the colums named with "Date" in the title to format "dd/mm/yyyy"


Recommended Posts

I actually don't know how to set the formatting in autoit - I know how to set it in vbs like this 

Set NewWorkBook = oEngine.Workbooks.Add 
NewWorkBook.SaveAs(NewXL) 
Set WorkBook = oEngine.Workbooks.Open(NewXL) 
Set InitSheet = WorkBook.Sheets.Item(1) 
    With InitSheet 
           .Range("A1","A1").NumberFormat = "@"
            .Range("A1:ZZ1").Font.Color = RGB(218,225,130)
            .Tab.ColorIndex=53
            .Cells.Font.Name = "Comic Sans"
            .Cells.Font.Size = 12   
            End With

Link to comment
Share on other sites

I dont know vbs. In these forums we are more focused on pushing you in the right direction rather than writing the code for you. If I ask for come code snippets it's because I need to have something that is relevant to your problem that I can test from my side to get it to work. In your first post I am not sure if you are looking for a column or row or header or tag or whatever. Obviously the syntax is different for the autoit code for different data locations.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

Translating VBS to Autoit isn't too hard:

; $oWorkbook is returned by _Excel_WorkbookOpen etc.
With $oWorkBook.ActiveSheet 
    .Range("A1").NumberFormat = "@"
;    .Range("A1:ZZ1").Font.Color = RGB(218,225,130) ; RGB is a VBS function and not available in AutoIt. If needed I can provide an example
    .Tab.ColorIndex=53
    .Cells.Font.Name = "Comic Sans"
    .Cells.Font.Size = 12   
EndWith

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

×
×
  • Create New...