- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
29-11-19 04:07 PM
is there a way to keep collection format when writing collection, collections i need to write are not standard and are always a mix of text and number.
Thank you
Marc
------------------------------
Marc Morin
Consultant
PWC
America/New_York
------------------------------
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-12-19 04:30 PM
Dim Format as String
Dim ColType as Type
ColType = col.DataType
If ColType = GetType(String) Then
Format = "@"
else
Format = "0.00"
End if
GetWorkbook(handle,Nothing).ActiveSheet.Range(cell,cell).NumberFormat = Format
so i can format cell before writing data, so far it's working fine
Cheers
------------------------------
Marc Morin
Consultant
PWC
America/New_York
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-11-19 11:43 AM
------------------------------
kaway cheung
medewerker communicatie en begeleiding
aegon
den haag
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-11-19 05:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-11-19 06:24 PM
------------------------------
Marc Morin
Consultant
PWC
America/New_York
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-11-19 06:25 PM
------------------------------
Marc Morin
Consultant
PWC
America/New_York
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-11-19 06:32 PM
You can use Format Cell as you please, eg: 0.00 will format that Excel cell/range/column to number with 2 decimal places, etc.
------------------------------
Scott Robson
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-12-19 05:15 AM
------------------------------
Krishna A
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-12-19 11:05 AM
Writing to a preformatted template is another option, like kaway mentioned.
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-12-19 04:30 PM
Dim Format as String
Dim ColType as Type
ColType = col.DataType
If ColType = GetType(String) Then
Format = "@"
else
Format = "0.00"
End if
GetWorkbook(handle,Nothing).ActiveSheet.Range(cell,cell).NumberFormat = Format
so i can format cell before writing data, so far it's working fine
Cheers
------------------------------
Marc Morin
Consultant
PWC
America/New_York
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-04-20 05:19 PM
I'm getting a bunch of errors when I paste that into a code stage. Can you explain a bit more what you are passing in or where you are doing this at.....
thanks!
Jon
------------------------------
Jonathan Holstine
Systems Accountant
Interior Business Center
America/Denver
------------------------------
