Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a celltype in Excel from VB6 2

Status
Not open for further replies.

Genotix

Programmer
Dec 16, 2004
53
0
0
NL
Hi All,

I'm trying to change the type of contents of one cell in Excel 2000.
Can't seem to find the command for it though.
Can anyone tell me how to do this and...

Does anyone know a online source where I can retrieve more information about connecting VB6 to Excel and also creating
charts?

Regards and thanx for your replies!

Linux IS userfriendly.
It's only very selective about who it's friends are.
 
Genotix,

What do you mean "the type of contents"? From value to formula? From Date to Number?

vladk
 
Genotix,
EXCEL ranges do not have "celltype" property

vladk
 
Just refer to the appropriate Range and use it's Value property.

myWorksheet.Range("A1").Value = "Fred"

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

For tsunami relief donations

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Well, i've filled a cell with value 10.00 (A percentage)
What excel does is putting a "€" sign in front of it, thinking it is a money value.

I would very much like to remove that crappy € sign.

Linux IS userfriendly.
It's only very selective about who it's friends are.
 
For simple XL stuff just go into Excel and record a Macro. You can then edit the code to suit your needs in VB. For this one:

myWorksheet.Range("A1").NumberFormat = "General"

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

For tsunami relief donations

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Use

myWorksheet.Range("A1").NumberFormat ="General"

or

myWorksheet.Range("A1").NumberFormat ="0.00%"

vladk
 
Thanx!!

I've found the VB script is quite useful.

Linux IS userfriendly.
It's only very selective about who it's friends are.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top