Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello. I have a little formula/code of sorts that I am trying to tweak. The
code basically places an "X'" in a cell no matter what the user types into the cell. Work great by the way! Now I want to make it even more difficult!!! lol... What I am trying to do is get this code to basically place an "X" in cell G25, an "L" in cell G26, a "M" in cell G27, etc...no matter what a user might type into the cell. This is what I have to work with. If anyone has any suggestions I would greatly appreciate. I thank you in advance for you time! Private Sub Worksheet_Change_0(ByVal Target As Excel.Range) Const sINPUTS As String = "G25, G26, G27" With Target If .Count 1 Then Exit Sub If Not Intersect(Range(sINPUTS), .Cells) Is Nothing Then If Not IsEmpty(.Value) Then On Error Resume Next Application.EnableEvents = False .Value = "2" Application.EnableEvents = True On Error GoTo 0 End If End If End With End Sub -- Randy Street Rancho Cucamonga, CA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Never mind...I got it...thanks anyways!
-- Randy Street Rancho Cucamonga, CA "Randy" wrote: Hello. I have a little formula/code of sorts that I am trying to tweak. The code basically places an "X'" in a cell no matter what the user types into the cell. Work great by the way! Now I want to make it even more difficult!!! lol... What I am trying to do is get this code to basically place an "X" in cell G25, an "L" in cell G26, a "M" in cell G27, etc...no matter what a user might type into the cell. This is what I have to work with. If anyone has any suggestions I would greatly appreciate. I thank you in advance for you time! Private Sub Worksheet_Change_0(ByVal Target As Excel.Range) Const sINPUTS As String = "G25, G26, G27" With Target If .Count 1 Then Exit Sub If Not Intersect(Range(sINPUTS), .Cells) Is Nothing Then If Not IsEmpty(.Value) Then On Error Resume Next Application.EnableEvents = False .Value = "2" Application.EnableEvents = True On Error GoTo 0 End If End If End With End Sub -- Randy Street Rancho Cucamonga, CA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto code to add tab | Excel Discussion (Misc queries) | |||
Auto Highlight Code | Excel Discussion (Misc queries) | |||
code for auto filters | Excel Programming | |||
Can I auto fill a cell in one worksheet by typing a code number | Excel Worksheet Functions | |||
auto zip code | Excel Worksheet Functions |