View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
cory cory is offline
external usenet poster
 
Posts: 54
Default Help with inputbox cel reference

Janet,

Some clarification may be needed, namely what you mean by wanting the macro
to work on every row. I will assume that you want to be able to run the macro
on whatever line you are currently on. If this is the case, you won't need
the Range("B63").Select command.

To find out the current line (row) that the macro is on use the following:

ActiveCell.Row

You can also simplify your code by assigning the InputBox statements
directly to a cell value rather than first assigning it to a variable and
then assigning that variable to the cell. Putting all of this together you
end up with the following:

ActiveSheet.Unprotect
Range("B" & ActiveCell.Row) = "x"
Range("J" & ActiveCell.Row) = Application.InputBox("Payment including
Adj")
Range("K" & ActiveCell.Row) = Application.InputBox("Enter total
overpayment remaining")
ActiveSheet.Protect

Hope this helps.
-Cory