Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Automating entry in a cell

I am trying to automate entry in a cell, in which the first digit will
always be the same value, such as "X", followed by a 6 digit number to
be entered. What I envision is that each cell in this column will have
the "X" value hardcoded in the first position so that entry of the 6
digit number can begin at the second position when the user selects the
cell. Another possibility would be for the user to enter the 6 digit
number and the "X" populate the cell in the first position when the
user exits the cell.

Is either of these feasible, and what would be the best way to
accomplish?

I appreciate any help!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,073
Default Automating entry in a cell

Hi,

This Worksheet_Change Event procedure adds 5000000 to any number
entered into column C. You could edit the code to suit your needs...

Private Sub Worksheet_Change(ByVal Target As Range)
'Change "C:C" to suit you needs
If Not Intersect(Target, Range("C:C")) Is Nothing Then
Dim rngCell As Range
For Each rngCell In Target
On Error Resume Next
Application.EnableEvents = False
'Change 5000000 to suit your needs
rngCell.Value = rngCell.Value + 5000000
Application.EnableEvents = True
Next rngCell
End If
End Sub

Paste the code into the worksheet's code module in the Visual Basic
Editor by right clicking the sheet tab, selecting "View Code" from the
popup menu then paste the copied code. Press Alt + F11 to return to
Excel.

If your Security level is higher than medium then go
Tools|Macro|Security... select Medium|OK|Close the workbook|ReOpen the
workbook|Select "Enable Macros" on the "Security Warning" dialog

Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Automating entry in a cell

You could try a custom format of:

"X"#

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"BrownsFan" wrote in message
ups.com...
I am trying to automate entry in a cell, in which the first digit will
always be the same value, such as "X", followed by a 6 digit number to
be entered. What I envision is that each cell in this column will have
the "X" value hardcoded in the first position so that entry of the 6
digit number can begin at the second position when the user selects the
cell. Another possibility would be for the user to enter the 6 digit
number and the "X" populate the cell in the first position when the
user exits the cell.

Is either of these feasible, and what would be the best way to
accomplish?

I appreciate any help!


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
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
Data Validation / Cell Entry Steve Jones Excel Discussion (Misc queries) 4 March 23rd 05 03:23 PM
resolving a numeric cell entry for its meaning vtcrob Excel Worksheet Functions 0 February 4th 05 02:23 AM
Move the last entry in a column to a different cell, when the loc. MicroSoft Excell (?) Excel Worksheet Functions 2 January 7th 05 09:29 PM


All times are GMT +1. The time now is 04:22 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"