How to format a cell with dashes and have the dashes appear in the FX?

pixie222

New Member
Joined
Apr 3, 2009
Messages
6
I have a list of account numbers that need to be listed as 000-0000-0000. I can format them using a custom format and have the dashes appear in the cell of the work sheet, but in the fx part, the account number is listed as 00000000000. In order for my macro to run correctly in our data base, we need the dashes to appear in the account number in the fx spot.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Do you want to do with VBA or a worksheet function in another column?

What does your macro do with the account numbers? Post the code.

With a worksheet function :-

<TABLE style="WIDTH: 246pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=328 border=0 x:str><COLGROUP><COL style="WIDTH: 246pt; mso-width-source: userset; mso-width-alt: 11995" width=328><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl24 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 246pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=328 height=17 x:str="'=LEFT(A1,3) & "-" & MID(A1,4,4) & "-" & RIGHT(A1,4)">=LEFT(A1,3) & "-" & MID(A1,4,4) & "-" & RIGHT(A1,4)</TD></TR></TBODY></TABLE>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,109
Members
449,205
Latest member
ralemanygarcia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top