Jump to content

Recommended Posts

Posted

Hi.

I'd like to assing a certain Cell Format to some Range in an Excel Sheet. (e.g. A:A as "text", "B:B" as "percent" and "C:C" as "numeric" (? "Zahl" ?))

Howto? I failed when trying to understand howto use _ExcelCellFormat():

Func _ExcelCellFormat($oExcel, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1, $fWrapText = False, $iOrientation = 0, $fAddIndent = False, $iIndentLevel = 0, $fShrinkToFit = False)

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Posted (edited)

Hi.

I'd like to assing a certain Cell Format to some Range in an Excel Sheet. (e.g. A:A as "text", "B:B" as "percent" and "C:C" as "numeric" (? "Zahl" ?))

Howto? I failed when trying to understand howto use _ExcelCellFormat():

Func _ExcelCellFormat($oExcel, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1, $fWrapText = False, $iOrientation = 0, $fAddIndent = False, $iIndentLevel = 0, $fShrinkToFit = False)

Regards, Rudi.

Wrong function. Try this one instead.

;===============================================================================
;
; Description:      Applies the specified formatting to the cells in the specified R1C1 Range.
; Syntax:           _ExcelNumberFormatR1C1($oExcel, $sRangeOrRowStart, $iColStart, $iRowEnd, $iColEnd, $sFormat)
; Parameter(s):     $oExcel - An Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew()
;                   $sFormat - The formatting string to apply to the specified range (see Notes below)
;                   $sRangeOrRowStart - Either an A1 range, or an integer row number to start from if using R1C1
;                   $iColStart - The starting column for the number format(left)
;                   $iRowEnd - The ending row for the number format (bottom)
;                   $iColEnd - The ending column for the number format (right) 
; Requirement(s):   None
; Return Value(s):  On Success - Returns 1
;                   On Failure - Returns 0 and sets @error on errors:
;                       @error=1 - Specified object does not exist
;                       @error=2 - Starting row or column invalid
;                           @extended=0 - Starting row invalid
;                           @extended=1 - Starting column invalid
;                       @error=3 - Ending row or column invalid
;                           @extended=0 - Ending row invalid
;                           @extended=1 - Ending column invalid
; Author(s):        SEO <locodarwin at yahoo dot com>
; Note(s):          For more information about possible formatting strings that can be
;                   used with this command, consult the book, "Programming Excel With
;                   VBA and .NET," by Steven Saunders and Jeff Webb, ISBN: 978-0-59-600766-9
;
;===============================================================================
Func _ExcelNumberFormat($oExcel, $sFormat, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1)
Edited by aslani

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Posted

Wrong function. Try this one instead.

Func _ExcelNumberFormat()

Thanks! Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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
×
×
  • Create New...