Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change format of a cell
I am having problems formatting a cell when sending a value from a textbox. Here is a part of what is being done
A User will enter a series of numbers into a textbox. When they exit the textbox, the value is reformate 'Add dashes when exiting textbo MRN_TxBx.Value = Format(MRN_TxBx.Value, "#00-00-00" If the user decides to re-enter the textbox, it removes the dashes to avoid any confusio 'Remove all dashes when entering textbo MRN_TxBx.Value = Replace(MRN_TxBx.Value, "-", "" When all is done, I copy the value to a cell with the following 'Format cell & add valu .Cells(NxtRow, 1).NumberFormat = "General .Cells(NxtRow, 1) = Data_Frm.MRN_TxBx.Valu When I check the cell with the value, the format of the cell is always a date. I don't want a date format, I need it to be general or text. Any ideas Thanks... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change format of a cell
.Cells(NxtRow, 1).NumberFormat = "General"
.Cells(NxtRow, 1) = "'" & Data_Frm.MRN_TxBx.Value -- Regards, Tom Ogilvy "Troy" wrote in message ... I am having problems formatting a cell when sending a value from a textbox. Here is a part of what is being done. A User will enter a series of numbers into a textbox. When they exit the textbox, the value is reformated 'Add dashes when exiting textbox MRN_TxBx.Value = Format(MRN_TxBx.Value, "#00-00-00") If the user decides to re-enter the textbox, it removes the dashes to avoid any confusion 'Remove all dashes when entering textbox MRN_TxBx.Value = Replace(MRN_TxBx.Value, "-", "") When all is done, I copy the value to a cell with the following: 'Format cell & add value .Cells(NxtRow, 1).NumberFormat = "General" .Cells(NxtRow, 1) = Data_Frm.MRN_TxBx.Value When I check the cell with the value, the format of the cell is always a date. I don't want a date format, I need it to be general or text. Any ideas? Thanks... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change format of a cell
Troy,
Horrible, but ... 'Format cell & add value .Cells(nxtrow, 1).NumberFormat = "General" .Cells(nxtrow, 1) = "'" & Data_Frm.MRN_TxBx.Text --- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Troy" wrote in message ... I am having problems formatting a cell when sending a value from a textbox. Here is a part of what is being done. A User will enter a series of numbers into a textbox. When they exit the textbox, the value is reformated 'Add dashes when exiting textbox MRN_TxBx.Value = Format(MRN_TxBx.Value, "#00-00-00") If the user decides to re-enter the textbox, it removes the dashes to avoid any confusion 'Remove all dashes when entering textbox MRN_TxBx.Value = Replace(MRN_TxBx.Value, "-", "") When all is done, I copy the value to a cell with the following: 'Format cell & add value .Cells(NxtRow, 1).NumberFormat = "General" .Cells(NxtRow, 1) = Data_Frm.MRN_TxBx.Value When I check the cell with the value, the format of the cell is always a date. I don't want a date format, I need it to be general or text. Any ideas? Thanks... |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change format of a cell
That worked! Thanks a bunch!!
|
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change format of a cell
That worked! Thanks a bunch!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Lock Cell Format - Allow copy and paste of data without format change | Excel Worksheet Functions | |||
Changing the cell format doesn't change existing cell content | Excel Discussion (Misc queries) | |||
cant change the cell format it shows too many different cell form | Excel Worksheet Functions | |||
Can cell format come from and change with reference cell format | Excel Discussion (Misc queries) | |||
How do i change the format of a cell based on the condition of another cell in same row? | Excel Programming |