View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Fish Fish is offline
external usenet poster
 
Posts: 10
Default Sequential looping

Group,

I am stuck on a problem in looping. Im trying to make it
so that I do not have to write 5 procedures for the 5
different Variables. But im getting an error with my
integer changing and the macro recognizing it as a
variable.

Thanks in advance


Fish

'''''Code

Dim x as integer
Dim Med1 As String, Med2 As String, Med3 As String, Med4
As String, Med5 As String


Med2 = "Advil"
Med3 = "Aleve"
Med4 = "Aspirin"
Med5 = "NyQuil"
Med6 = "Day Quil"

x = 1

Do
Med = Med1 + x
ActiveCell.Offset(0, -1).Value = Med
ActiveCell.Offset(1, 0).Select
x = x + 1
Loop Until ActiveCell.Offset(-1, -1).Value = Med6