Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with this conditional IF statement | Excel Discussion (Misc queries) | |||
cell color index comparison | New Users to Excel | |||
Data Validation / Cell Entry | Excel Discussion (Misc queries) | |||
resolving a numeric cell entry for its meaning | Excel Worksheet Functions | |||
Move the last entry in a column to a different cell, when the loc. | Excel Worksheet Functions |