Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with calling an Excel program in a Excel cell

I wrote a function to sum up numbers I entered in Excel cell "A1" .
The program continuously sums up the numbers and clears cell "A1".
Cell "B1" is to store this summation .
I tried making the formular of cell "B1" to be the result of this
function that is making cell "B1" call this function.
See below :
Function SUMMM(A1)
Private SUM_UP
SUM_UP = A1 + SUM_UP
SUMMM(A1) = SUM_UP
Range ("A1").value = ""
End Function
I made the formular of cell "B1" to be : = SUMMM(A1) . It is giving
error message :#name
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Help with calling an Excel program in a Excel cell

You could try this alternative.

Right click your sheet tab, view code and paste this in

Dim TargetVal
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
If TargetVal < Target Then
Target.Offset(1, 0).Value = Target.Offset(1, 0).Value + Target
End If
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
TargetVal = Target
End If
End Sub

Mike

"chichi" wrote:

I wrote a function to sum up numbers I entered in Excel cell "A1" .
The program continuously sums up the numbers and clears cell "A1".
Cell "B1" is to store this summation .
I tried making the formular of cell "B1" to be the result of this
function that is making cell "B1" call this function.
See below :
Function SUMMM(A1)
Private SUM_UP
SUM_UP = A1 + SUM_UP
SUMMM(A1) = SUM_UP
Range ("A1").value = ""
End Function
I made the formular of cell "B1" to be : = SUMMM(A1) . It is giving
error message :#name

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Help with calling an Excel program in a Excel cell

Hi,

I should have trapped for non numeric entry, try this instead

Dim TargetVal
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
If TargetVal < Target And IsNumeric(Target) Then
Target.Offset(1, 0).Value = Target.Offset(1, 0).Value + Target
End If
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
TargetVal = Target
End If
End Sub

"Mike H" wrote:

You could try this alternative.

Right click your sheet tab, view code and paste this in

Dim TargetVal
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
If TargetVal < Target Then
Target.Offset(1, 0).Value = Target.Offset(1, 0).Value + Target
End If
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
TargetVal = Target
End If
End Sub

Mike

"chichi" wrote:

I wrote a function to sum up numbers I entered in Excel cell "A1" .
The program continuously sums up the numbers and clears cell "A1".
Cell "B1" is to store this summation .
I tried making the formular of cell "B1" to be the result of this
function that is making cell "B1" call this function.
See below :
Function SUMMM(A1)
Private SUM_UP
SUM_UP = A1 + SUM_UP
SUMMM(A1) = SUM_UP
Range ("A1").value = ""
End Function
I made the formular of cell "B1" to be : = SUMMM(A1) . It is giving
error message :#name

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
Pivot Refresh Error when calling Excel Macro from VB.NET program amdefacto Excel Discussion (Misc queries) 0 July 6th 09 10:06 AM
calling a C++ program from Excel 2000 and passing a result from C++ back to an excel spreadsheet ellis kurland Excel Discussion (Misc queries) 3 August 15th 05 04:10 PM
Program calling up Excel - Not running Macro kraljb[_4_] Excel Programming 1 May 28th 05 06:23 AM
calling macro in excel from VB program Fung Excel Programming 1 July 21st 04 01:54 PM
Calling Access Program from Excel John Baker Excel Programming 1 April 24th 04 01:20 PM


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"