• Answers
  • Web
Answer 1 out of 1
 
10 helpful answers
A:

You'll need a loop to go through cells. Here is my suggestion: Sub AddToCell() 'Do starts a loop Do 'Here is your original macro row ActiveCell.Value = ActiveCell.Value + Val(InputBox("3100", default:=1)) 'Select next cell ActiveCell.Offset(1, 0).Select 'Loop ends here if next cell has no value entered Loop Until IsEmpty(ActiveCell.Value) End Sub I don't know, why you are using input box here. If you need to add numbers 32 in front of all numbers, I would automate that also, in example like this: Sub AddToCell3() 'Do starts a loop Do 'Here is your original macro row ActiveCell.Value = "32" & ActiveCell.Value 'Select next cell ActiveCell.Offset(1, 0).Select 'Loop ends here if next cell has no value entered Loop Until IsEmpty(ActiveCell.Value) End Sub

Posted 2 months ago
EscApe was invited by Yedda to answer this question.

 
Comment About This Answer (or add your own answer)

Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
  • Answers
  • Web
Copyright © 2006-2009, Yedda Inc. and respective copyright owners