#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default VBA Program

Rudy, there is no reason, based on the worksheet_change code, why any other
user could not enter a "C" in any cell of Range("C12:C500") and the code
would not execute. Although, as Don pointed out, the code itself could be
more efficiently written. One thing you could do, is change this line from:

If Target.Value = "C" And Target.Offset(0, 11) _
.Value < "" Then

To:

If UCase(Target.Value) = "C" And Target.Offset(0, 11) _
.Value < "" Then


That way, it would execute for "c" or "C". Also, the other user could have
been trying to enter the "C" in rows 1 thru 11, which the code would have
ignored. The executable range begins in row 12.


"Rudy" wrote:

Hi,

This is the sheet module


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo endit
If Intersect(Target, Range("C12:C500")) Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each Cell In Target
If Target.Value = "C" And Target.Offset(0, 11) _
.Value < "" Then
With Target
.Offset(0, 12).Value = Target.Offset(0, 11).Value
.Offset(0, 11).ClearContents
End With
End If
Next
endit:
Application.EnableEvents = True
End Sub

Private Sub Worksheet_BeforeRightClick _
(ByVal Target As Excel.Range, Cancel As Boolean)
If IsNumeric(Target) And Not IsEmpty(Target) Then
Application.Dialogs(xlDialogFormatNumber).Show
Cancel = True
End If
End Sub


"Jim Cone" wrote:

The code you posted is incomplete.
Please try again.
Also, what module contains the code - the sheet module or a standard module?
--
Jim Cone
Portland, Oregon USA



"Rudy"
wrote in message
Hi,
There is this VBA program in my excel sheet that tells excel to :
Function MATHEMATICS()
IF C14="C"
N14 TO M14
End Function

If I am the one opening up this spreadsheet & type in the letter "C" on
column C14, the value in column "N14" automatically transposes on column
"O14". However, if someone else has opened this spreadsheet & type in "C" on
column C14, the value in N14 does not automatically transposes on column
"O14". Pls help as I am going to handover this job to another person but if
this problem cannot be resolved, he has to do the old fashion way. Thanks...

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
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
Program juanpablo Excel Discussion (Misc queries) 0 July 2nd 08 02:12 AM
Program Todd Huttenstine[_2_] Excel Programming 2 January 12th 04 10:14 AM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM


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