Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Input Masks or equivilent

Is it possible to create something similar to what is called input masks in
Access?

For example, in my Excel spreadsheet I want to be able to type a 9-digit
account number (which contains letters and numbers) into a cell and
automatically have a hyphen inserted after the first four characters. Also, I
want to be able to designate a default value (2007) that will appear in all
the cells of a column, but which the user can change to a different value
when neccessary (for example, 2006, or 2006-2007).

I think that I should be able to do this with a custom cell format, but I
have not been able to achieve this. Does anyone have any guidance to offer?
It would be MUCH appreciated!!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 694
Default Input Masks or equivilent

You can't do the formating similar to Access in Excel cells.

You can format cells as numbers or strings.

A possiible solution is to use the on_change vba macro but there are
problems with it and the coding is quite complex and you have to consider how
you deal with formula. For example i enter in C1 =A1&10*15

How do you format that.

Try this it deals with column C.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim s As String
On Error Resume Next
'say you are working on the column C
If Target.Column = 3 Then
On Error Resume Next
Application.EnableEvents = False
s = Target.Value
Target.Value = Left(s, 1) & "-" & Mid(s, 2, Len(s) - 1)
Application.EnableEvents = True
End If
End Sub

You can't put default values in like access because excel is sheet based and
not row based. You would have to put for versions < 12 over 65,000 rows of
default values or have a complete testing event.

What you are implying is that you want to enter data so use a form and deal
with defaults that way.

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Courtney" wrote:

Is it possible to create something similar to what is called input masks in
Access?

For example, in my Excel spreadsheet I want to be able to type a 9-digit
account number (which contains letters and numbers) into a cell and
automatically have a hyphen inserted after the first four characters. Also, I
want to be able to designate a default value (2007) that will appear in all
the cells of a column, but which the user can change to a different value
when neccessary (for example, 2006, or 2006-2007).

I think that I should be able to do this with a custom cell format, but I
have not been able to achieve this. Does anyone have any guidance to offer?
It would be MUCH appreciated!!

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
Are Input masks available in Excel? Ray with Group O Excel Discussion (Misc queries) 0 November 8th 06 03:34 PM
Input masks in Excel Chris Excel Discussion (Misc queries) 1 October 16th 06 09:47 PM
input masks and validation archiboy Excel Discussion (Misc queries) 3 October 11th 05 03:05 PM
input box Monty Excel Discussion (Misc queries) 2 October 7th 05 08:33 AM
Input Masks in Excel? PattiP Setting up and Configuration of Excel 5 May 24th 05 08:34 PM


All times are GMT +1. The time now is 11:04 PM.

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

About Us

"It's about Microsoft Excel"