Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Cell Auto Code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Cell Auto Code

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
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
Auto code to add tab Very Basic User Excel Discussion (Misc queries) 3 November 11th 09 01:58 PM
Auto Highlight Code joelbeveridge Excel Discussion (Misc queries) 2 August 4th 06 02:11 AM
code for auto filters Gordon[_2_] Excel Programming 2 January 20th 06 11:29 AM
Can I auto fill a cell in one worksheet by typing a code number Gomer Pyle Excel Worksheet Functions 1 August 27th 05 01:24 AM
auto zip code esslingerdav Excel Worksheet Functions 1 January 18th 05 06:55 PM


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