... will convert numbers to numbers, but there are times that numbers are (product codes) and need to be Char.
With OLE and functions like Set( "NumberFormat", '0.00' ) I can do this... looking for more samples at the moment.....
I found small samples like this, but they look more complex... We will ...
Search found 30 matches: numberformat
Searched query: numberformat
- Thu Jun 03, 2021 1:41 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: TOleAuto () versus FW_ExcelToDBF()
- Replies: 10
- Views: 1302
- Thu Mar 18, 2021 6:39 pm
- Forum: FiveWin para Harbour/xHarbour
- Topic: Error en excel
- Replies: 0
- Views: 407
Error en excel
... Borders():LineStyle := 1
objExcel:Range("K7:L56"):Borders():LineStyle := 1
objExcel:Range("B7:L56"):Font:Size := 8
objExcel:Range("C7:C56"):NumberFormat := "###" // FORMATEAR CELDA NUMERICA
nRen:=7
nCol:=2
Select 1
Do while !Eof()
objExcel:Cells(nRen,nCol):Value := Alltrim(aInven->Descript ...
objExcel:Range("K7:L56"):Borders():LineStyle := 1
objExcel:Range("B7:L56"):Font:Size := 8
objExcel:Range("C7:C56"):NumberFormat := "###" // FORMATEAR CELDA NUMERICA
nRen:=7
nCol:=2
Select 1
Do while !Eof()
objExcel:Cells(nRen,nCol):Value := Alltrim(aInven->Descript ...
- Wed Jul 10, 2019 7:37 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: FW_DbfToExcel() problem
- Replies: 5
- Views: 1719
Re: FW_DbfToExcel() problem
... nRow := 2
Please insert one new line of code between these two lines as below:
oRange:Rows( 1 ):Value := aHead
AEval( Eval( bLine ), { |u,i| If( ValType( u ) == "C", oRange:Columns( i ):NumberFormat := "@", nil ) } )
nRow := 2
Please let us know if this resolves your issue.
Please insert one new line of code between these two lines as below:
oRange:Rows( 1 ):Value := aHead
AEval( Eval( bLine ), { |u,i| If( ValType( u ) == "C", oRange:Columns( i ):NumberFormat := "@", nil ) } )
nRow := 2
Please let us know if this resolves your issue.
- Sat Dec 09, 2017 8:07 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: Set Date British
- Replies: 3
- Views: 536
Re: Set Date British
Cells(1, 1):Value = doc(date())
Cells(1, 1):NumberFormat = "dd/mm/yyyy"
Cells(1, 1):NumberFormat = "dd/mm/yyyy"
- Thu Oct 19, 2017 5:06 pm
- Forum: FiveWin para Harbour/xHarbour
- Topic: Formato de numeros con tOleAuto, no lo asepta
- Replies: 3
- Views: 620
Formato de numeros con tOleAuto, no lo asepta
... la hoja que estoy creando, al final para dar formato a los campos numericos doy:
oSheet:Range("A1:H"+Alltrim(Str(oSheet:UsedRange:Rows:Count()))):NumberFormat:="###,##0.00"
y las cifras me la pone:
-4615952,98 cuendo es -4,615,952.98
4219371,98 4.219,371.98
-396581 -396,581.00
alguna sugerencia?
oSheet:Range("A1:H"+Alltrim(Str(oSheet:UsedRange:Rows:Count()))):NumberFormat:="###,##0.00"
y las cifras me la pone:
-4615952,98 cuendo es -4,615,952.98
4219371,98 4.219,371.98
-396581 -396,581.00
alguna sugerencia?
- Mon Aug 01, 2016 11:12 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: Excel difference 32bit vs 64bit?
- Replies: 1
- Views: 425
Re: Excel difference 32bit vs 64bit?
oSheet:Cells( 1, 1 ):NumberFormat :=
Please do not use it as a function.
Please do not use it as a function.
- Thu Apr 07, 2016 3:03 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: Adjusting alignment in Excel
- Replies: 3
- Views: 1003
Re: Adjusting alignment in Excel
... dmcritchie.mvps.org/excel/colors.htm
// Alignment...
oAs:Range ('C'+LTRIM(STR(nRow))+':C65536'):HorizontalAlignment = xlHAlignCenter
oAs:Range ('M'+LTRIM(STR(nRow))+':M65536'):HorizontalAlignment = xlHAlignRight
oAs:Range ('K'+LTRIM(STR(nRow))+':K65536'):NumberFormat = '###,###,###.00'
// Alignment...
oAs:Range ('C'+LTRIM(STR(nRow))+':C65536'):HorizontalAlignment = xlHAlignCenter
oAs:Range ('M'+LTRIM(STR(nRow))+':M65536'):HorizontalAlignment = xlHAlignRight
oAs:Range ('K'+LTRIM(STR(nRow))+':K65536'):NumberFormat = '###,###,###.00'
- Thu Dec 10, 2015 9:40 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: Export to Calc problem
- Replies: 4
- Views: 1850
Export to Calc problem
... 0
cFormat := Left( cformat, nAt ) + '"' + SubStr( cFormat, nAt + 1 ) + '"'
endif
endif
oSheet:GetColumns():GetByIndex( nCol-1 ):NumberFormat:=GetNumberFormatId(oBook, cFormat, cType)
oSheet:GetColumns():GetByIndex( nCol-1 ):HoriJustify = 3 // 3 Right Alignement
Any ideas ? Thank ...
cFormat := Left( cformat, nAt ) + '"' + SubStr( cFormat, nAt + 1 ) + '"'
endif
endif
oSheet:GetColumns():GetByIndex( nCol-1 ):NumberFormat:=GetNumberFormatId(oBook, cFormat, cType)
oSheet:GetColumns():GetByIndex( nCol-1 ):HoriJustify = 3 // 3 Right Alignement
Any ideas ? Thank ...
- Tue Jun 16, 2015 3:04 pm
- Forum: FiveWin para Harbour/xHarbour
- Topic: Ayuda con Exportacion a Excel
- Replies: 14
- Views: 2438
Re: Ayuda con Exportacion a Excel
Gracias a todos por su colaboracion
Disculpandome por la demora en responder la funcion que me funciono perfectamente fue esta
oSheet:Cells(nRow, nCol):Set("NumberFormat","@")
Gracias por el aporte
Saludos
Disculpandome por la demora en responder la funcion que me funciono perfectamente fue esta
oSheet:Cells(nRow, nCol):Set("NumberFormat","@")
Gracias por el aporte
Saludos
- Fri Jun 05, 2015 5:35 pm
- Forum: FiveWin para Harbour/xHarbour
- Topic: Ayuda con Exportacion a Excel
- Replies: 14
- Views: 2438
Re: Ayuda con Exportacion a Excel
Amigos
Indico el Numero de la columna para que el solo haga el incremento por la linea (dejo fijo la columna 3, y hace el incremento por linea), ya intente con el numberformat pero eso sirve solamente para convertir la columna a formato numerico (no para convertirla a formato texto)
Indico el Numero de la columna para que el solo haga el incremento por la linea (dejo fijo la columna 3, y hace el incremento por linea), ya intente con el numberformat pero eso sirve solamente para convertir la columna a formato numerico (no para convertirla a formato texto)
- Wed Jan 07, 2015 10:17 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: Migrating to Harbour
- Replies: 238
- Views: 57101
Re: Migrating to Harbour
Enrico
Can you try something like this ?
oSheet:Range( "A:A" ):Set( "NumberFormat", '00/00/00' ) // field mask// sets headersoSheet:Cells( 1, 1 ):value := "Date".........Do while ... oSheet:Cells( nRow, 1 ):Value   ...
Can you try something like this ?
oSheet:Range( "A:A" ):Set( "NumberFormat", '00/00/00' ) // field mask// sets headersoSheet:Cells( 1, 1 ):value := "Date".........Do while ... oSheet:Cells( nRow, 1 ):Value   ...
- Wed Dec 24, 2014 6:17 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: Migrating to Harbour
- Replies: 238
- Views: 57101
Re: Migrating to Harbour
As of now there is no way except review all our code and modify wherever dates are assigned.
oSheet:Cells(r,c):NumberFormat := "dd-mm-yyyy" // or similar
oSheet:Cells(r,c):Value := If( Year(d) < 1900, nil, d )
I prefer
oSheet:Cells(r,c):Value := If( Year(d) < 1900, AdoNull(), d )
This works with ...
oSheet:Cells(r,c):NumberFormat := "dd-mm-yyyy" // or similar
oSheet:Cells(r,c):Value := If( Year(d) < 1900, nil, d )
I prefer
oSheet:Cells(r,c):Value := If( Year(d) < 1900, AdoNull(), d )
This works with ...
- Mon Sep 15, 2014 9:48 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: OpenOffice Calc
- Replies: 3
- Views: 922
OpenOffice Calc
Hi
Can anyone share a code snippet to allow me to do this in Calc? In Excel, I use
oSheet:Range(aColumns[16]+"5:"+aColumns[16]+ltrim(str(nRow))):NumberFormat := "####0.0000"
I looked at ToCalc in xBrowse but I'm lost
TIA
David
Can anyone share a code snippet to allow me to do this in Calc? In Excel, I use
oSheet:Range(aColumns[16]+"5:"+aColumns[16]+ltrim(str(nRow))):NumberFormat := "####0.0000"
I looked at ToCalc in xBrowse but I'm lost

TIA
David
- Wed Aug 20, 2014 2:23 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: Cells format in Excel 2013, Mr Rao ??
- Replies: 4
- Views: 779
Cells format in Excel 2013, Mr Rao ??
... Excel file with Office 2013, I have no problem with previous versions, in all previous cases put the following line:
oSheet: Cells (NFIL, 6): NumberFormat: = "#, ## 0.00"
And I format the cell with "," as thousand separator, with "." as decimal point and 2 decimal digits, but in Office 2013 I do ...
oSheet: Cells (NFIL, 6): NumberFormat: = "#, ## 0.00"
And I format the cell with "," as thousand separator, with "." as decimal point and 2 decimal digits, but in Office 2013 I do ...
- Tue Aug 19, 2014 11:28 pm
- Forum: FiveWin para Harbour/xHarbour
- Topic: TOle Diferencia entre Office 2013 y Office 2010
- Replies: 10
- Views: 2179
Re: TOle Diferencia entre Office 2013 y Office 2010
... 2013, problema que no tengo con las versiones anteriores, en todos los casos anteriores coloco la siguiente linea :
oHoja :Cells( nFil, 6 ):NumberFormat := "#,##0.00"
Y me formatea la celda con "," como separador de miles, con "." como indicador decimal y con 2 digitos decimales, pero en Office ...
oHoja :Cells( nFil, 6 ):NumberFormat := "#,##0.00"
Y me formatea la celda con "," como separador de miles, con "." como indicador decimal y con 2 digitos decimales, pero en Office ...