Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tspraetz
 
Posts: n/a
Default How do I format charge card numbers?

I want to format cells to accept charge card numbers with the spaces.
  #2   Report Post  
Kassie
 
Posts: n/a
Default

Hi

with the selected cell, right click, select Format Cells, select custom, and
enter "0"'s where you want digits, and spaces where you want spaces, eg"0000
0000 0000 000". While when entering it will not have spaces, it will enter
correctly.


"tspraetz" wrote:

I want to format cells to accept charge card numbers with the spaces.

  #3   Report Post  
tspraetz
 
Posts: n/a
Default

Kassie,

I did that, but for some reason it changes the last digit to a zero.

"Kassie" wrote:

Hi

with the selected cell, right click, select Format Cells, select custom, and
enter "0"'s where you want digits, and spaces where you want spaces, eg"0000
0000 0000 000". While when entering it will not have spaces, it will enter
correctly.


"tspraetz" wrote:

I want to format cells to accept charge card numbers with the spaces.

  #4   Report Post  
DS NTE
 
Posts: n/a
Default

Excel uses 15 digits, format as text.

knut
"tspraetz" skrev i melding
...
Kassie,

I did that, but for some reason it changes the last digit to a zero.

"Kassie" wrote:

Hi

with the selected cell, right click, select Format Cells, select custom,
and
enter "0"'s where you want digits, and spaces where you want spaces,
eg"0000
0000 0000 000". While when entering it will not have spaces, it will
enter
correctly.


"tspraetz" wrote:

I want to format cells to accept charge card numbers with the spaces.



  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

You can format the cell as text (like DS NTE wrote).

Or you can prefix your entry with a single quote.

'1234123412341234

And it'll be treated as text.

tspraetz wrote:

I want to format cells to accept charge card numbers with the spaces.


--

Dave Peterson


  #6   Report Post  
tspraetz
 
Posts: n/a
Default

I wanted to Custom Format the cells for charge card numbers that are 16
digit. DS NTE was right about Excel usings 15 digits. Yes using "text" will
not help me in this situation.

Thanks

"Dave Peterson" wrote:

You can format the cell as text (like DS NTE wrote).

Or you can prefix your entry with a single quote.

'1234123412341234

And it'll be treated as text.

tspraetz wrote:

I want to format cells to accept charge card numbers with the spaces.


--

Dave Peterson

  #7   Report Post  
CLR
 
Posts: n/a
Default

Yes using "text" will
not help me in this situation.



Why not?

Vaya con Dios,
Chuck, CABGx3


"tspraetz" wrote in message
...
I wanted to Custom Format the cells for charge card numbers that are 16
digit. DS NTE was right about Excel usings 15 digits. Yes using "text"

will
not help me in this situation.

Thanks

"Dave Peterson" wrote:

You can format the cell as text (like DS NTE wrote).

Or you can prefix your entry with a single quote.

'1234123412341234

And it'll be treated as text.

tspraetz wrote:

I want to format cells to accept charge card numbers with the spaces.


--

Dave Peterson



  #8   Report Post  
tspraetz
 
Posts: n/a
Default

I want to format this: 0000 0000 0000 0000 Charge Card Numer format. When you
type all the numbers down the column it would put the spaces in the number.
If you select text there is no place to enter your custom format like the
example above example.

"CLR" wrote:

Yes using "text" will
not help me in this situation.



Why not?

Vaya con Dios,
Chuck, CABGx3


"tspraetz" wrote in message
...
I wanted to Custom Format the cells for charge card numbers that are 16
digit. DS NTE was right about Excel usings 15 digits. Yes using "text"

will
not help me in this situation.

Thanks

"Dave Peterson" wrote:

You can format the cell as text (like DS NTE wrote).

Or you can prefix your entry with a single quote.

'1234123412341234

And it'll be treated as text.

tspraetz wrote:

I want to format cells to accept charge card numbers with the spaces.

--

Dave Peterson




  #9   Report Post  
CLR
 
Posts: n/a
Default

OIC...........one way to "get there" would be to type each 4-digit group
into it's own column, and then CONCATENATE them together at the end
with.......

=A1&" "&B1&" "&C1&" "&D1

Vaya con Dios,
Chuck, CABGx3

"tspraetz" wrote in message
...
I want to format this: 0000 0000 0000 0000 Charge Card Numer format. When

you
type all the numbers down the column it would put the spaces in the

number.
If you select text there is no place to enter your custom format like the
example above example.

"CLR" wrote:

Yes using "text" will
not help me in this situation.



Why not?

Vaya con Dios,
Chuck, CABGx3


"tspraetz" wrote in message
...
I wanted to Custom Format the cells for charge card numbers that are

16
digit. DS NTE was right about Excel usings 15 digits. Yes using "text"

will
not help me in this situation.

Thanks

"Dave Peterson" wrote:

You can format the cell as text (like DS NTE wrote).

Or you can prefix your entry with a single quote.

'1234123412341234

And it'll be treated as text.

tspraetz wrote:

I want to format cells to accept charge card numbers with the

spaces.

--

Dave Peterson






  #10   Report Post  
Dave Peterson
 
Posts: n/a
Default

The bad news is that numberformat works with numbers. If you keep your data as
numbers, you lose the 16th character. If you change the value to text (either
preformatting or using the leading apostrophe), then numberformat won't work.

On way around it is to use a worksheet event that does the "formatting" for
you. It actually changes the value by inserting spaces.

If you want to try this idea, rightclick on the worksheet tab that should have
this behavior. Select view code. Paste this into the code window:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim myTempVal As Variant

On Error GoTo errhandler:

If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("a:a")) Is Nothing Then Exit Sub
If IsNumeric(Target.Value) = False Then Exit Sub

myTempVal = CDec(Target.Value)
Application.EnableEvents = False
Target.Value = Format(myTempVal, "0000 0000 0000 0000")

errhandler:
Application.EnableEvents = True

End Sub

I used all of column A in this line:
If Intersect(Target, Me.Range("a:a")) Is Nothing Then Exit Sub
but you could use:
If Intersect(Target, Me.Range("c7:g99")) Is Nothing Then Exit Sub

But make sure whatever range you use is preformatted to text. If you leave it
general, then that 16th digit is already a 0 when the code starts.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


tspraetz wrote:

I wanted to Custom Format the cells for charge card numbers that are 16
digit. DS NTE was right about Excel usings 15 digits. Yes using "text" will
not help me in this situation.

Thanks

"Dave Peterson" wrote:

You can format the cell as text (like DS NTE wrote).

Or you can prefix your entry with a single quote.

'1234123412341234

And it'll be treated as text.

tspraetz wrote:

I want to format cells to accept charge card numbers with the spaces.


--

Dave Peterson


--

Dave Peterson


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format numbers in chart datatable MB Charts and Charting in Excel 3 May 29th 05 03:37 PM
Checking Winning Numbers in the Lottery. Ann Excel Discussion (Misc queries) 4 May 18th 05 10:55 AM
Converting Numbers to Text properly Shirley Munro Excel Discussion (Misc queries) 1 February 16th 05 03:01 PM
Converting numbers to date format from csv files FiBee Excel Discussion (Misc queries) 1 January 12th 05 01:30 PM
finance charge on credit card min Excel Worksheet Functions 1 November 1st 04 01:37 PM


All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"