View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Increment Cell Value by 1

I don't have a programming background, so I need to ask, How do I assign the
button to this code?

Thanks very much,
Bob

"Gary''s Student" wrote:

Assign your button to:

Sub marine()
With Workbooks("Book1.xls").Sheets("Sheet1").Range("C2" )
.Value = .Value + 1
End With
End Sub

--
Gary's Student
gsnu200703


"bob" wrote:

I have a fairly simple operation I am trying to implement.

I have a command button called "Screen" in worksheet "Sheet1" of Workbook
"Book1". When I click it, I want the value in cell C2 to increase by one
(e.g., if C2 = 3, I want it to automatically increase to 4 when I click
Screen.

Can anyone provide code for this operation?

Thanks,
Bob