LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Adding two values

I have a question about the following code,

Dim ans

On Error Resume Next


ans = Application.Match(CLng(Label1.Caption), Range("A:A"), 0)
If Not IsError(ans) Then
Application.Index(Range("B:B"), ans) = Label2.Caption +
ActiveCell.Value


Else
MsgBox "Invalid code"
End If
On Error GoTo 0
What I am trying to achieve is with the Application.Index line
How do I get the two values to add together I have tested the code and it
puts the figures where they should go but what i am trying to make happen is
if the cell already has value in it.

i.e. the cell has 2 in it already and label2 has the value of 5 i want i to
show 7 in the cell.

I believe the following line is the problem

= Label2.Caption + ActiveCell.Value

Thanks

Greg


 
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
Adding mm:ss values Howard Kaikow Excel Worksheet Functions 10 August 13th 09 05:21 PM
Adding Values Sandy Excel Worksheet Functions 3 May 4th 08 04:39 PM
Adding numerical values based on multiple values in another column Kazmaniac Excel Worksheet Functions 6 April 4th 07 08:53 PM
adding name values AKPhil Excel Worksheet Functions 7 April 27th 06 01:21 AM
adding name values AKPhil Excel Discussion (Misc queries) 1 April 26th 06 09:41 PM


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