View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Update Current Row

Your sub if full of undesirable selections. And, why won't one macro
assigned to one button work for the activecell.row
Don't use command button

Sub fillinformulas()'assign to button or shape
ar = ActiveCell.Row
Cells(ar, "c") = InputBox("Enter This Runs Figures:")
If Cells(ar, "c") = "" Then MsgBox "oh oh"
Cells(ar, "d") = Cells(ar, "c") + Cells(ar, "e")

End Sub
instead of
Range("B5").Select
Selection = Range("C5")
Range("C5").Select
Selection.ClearContents

Range("C5").Select
Selection = InputBox("Enter This Runs Figures:")
If Response1 = vbYes Then

If Selection = "" Then
MsgBox "Nothing to enter"
Else
MsgBox "you cancelled"
End If
End If

ActiveSheet.Range("D5").Value = ActiveSheet.Range("E5").Value + _
ActiveSheet.Range("C5").Value



--
Don Guillett
SalesAid Software

"enyaw" wrote in message
...
Range("B5").Select
Selection = Range("C5")
Range("C5").Select
Selection.ClearContents

Range("C5").Select
Selection = InputBox("Enter This Runs Figures:")
If Response1 = vbYes Then

If Selection = "" Then
MsgBox "Nothing to enter"
Else
MsgBox "you cancelled"
End If
End If

ActiveSheet.Range("D5").Value = ActiveSheet.Range("E5").Value + _
ActiveSheet.Range("C5").Value

I have this code attached to a command button in G5. This works fine. My
problem is that I have more than one row that needs to be like this and i
need to be able to run the code seperately for whatever row i choose. So
there will be a number of command buttons. I need the code to run on the
same row as the command button and nowhere else. Can anyone help?