Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming,microsoft.public.il.hebrew.vb,microsoft.public.vb.syntax
|
|||
|
|||
Formatting a cell in Excel, using pure VB code
Hi all,
I have a problem with excel cell formatting. One of the columns should contain phone numbers (a number that starts with zero ... sometimes) The VB program puts a phone number lets say - "03555555" When I open the file from Excel - I see the number without the zero. I saw that the format of the cell is "General" however I think I should set the format of the cell to "Text" I tried several code lines but none helped Like: xlsSheet.Cells(1 + I, 3).NumberFormat="Text" - This did not work xlsSheet.Cells(1 + I, 3)=Chr$(34) & sPhoneNumber & Chr$(34) - With this , the cells contained "" xlsSheet.Cells(1 + I, 3).NumberFormat="00000000" - In this case, when I put numbers shorter than the number of 0 , example - "031234", the cell contained "00031234" Please someone show me the right way ... Thank you Frustrated Guy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Formatting Code for SI Units in Excel | Excel Worksheet Functions | |||
conditional formatting w/ more than 3 conditionas, color code to a different cell | About this forum | |||
R6025 pure virtual funtion call | Excel Discussion (Misc queries) | |||
Runtime Error! R6025 -pure virtual function call | Excel Discussion (Misc queries) |