Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Greg,
Just pass the value of the label to a variable and then add that to the activecell see code below. I think the problem you were having is that a caption is a string not a value. Dim ans Dim lbl2 as interger On Error Resume Next ans = Application.Match(CLng(Label1.Caption), Range("A:A"), 0) If Not IsError(ans) Then lbl2 = cint(Label2.Caption) Application.Index(Range("B:B"), ans) = lbl2 + ActiveCell.Value Else MsgBox "Invalid code" End If On Error GoTo 0 This is untested code. Cint converts the caption to an interger. Any problems then post back. James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding mm:ss values | Excel Worksheet Functions | |||
Adding Values | Excel Worksheet Functions | |||
Adding numerical values based on multiple values in another column | Excel Worksheet Functions | |||
adding name values | Excel Worksheet Functions | |||
adding name values | Excel Discussion (Misc queries) |