PC Review


Reply
Thread Tools Rate Thread

Cell Auto Code

 
 
Randy
Guest
Posts: n/a
 
      31st Dec 2008
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 With Quote
 
 
 
 
Randy
Guest
Posts: n/a
 
      31st Dec 2008
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Microsoft Excel Misc 0 29th Jun 2009 11:20 AM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Yuvraj Microsoft Excel Misc 0 26th Jun 2009 06:01 PM
Can I auto fill a cell in one worksheet by typing a code number =?Utf-8?B?R29tZXIgUHlsZQ==?= Microsoft Excel Worksheet Functions 1 27th Aug 2005 01:24 AM
How2prevent excel from auto formatng n auto aplying formula 2 a cell wen opening a fi MikeVince Microsoft Excel Misc 0 26th Feb 2004 04:14 PM
auto-updating an auto text field code value Glennard Lud Microsoft Word Document Management 1 10th Jul 2003 11:16 AM


Features
 

Advertising
 

Newsgroups
 


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