hgsouthall
New Member
- Joined
- Apr 25, 2013
- Messages
- 1
Hello! I'm having trouble with what should be a relatively simple macro. I'm trying to input a specific number of coordinates. The number of coordinates is determined by the user through an input box. When the row number equals the inputbox number, I would like the inputbox prompt to stop asking for more coordinates. This is what I have so far.
I would appreciate any help you could give me.
Code:
Option Explicit
Sub Cholera()
DIM i as integer: 'Row counter
DIM M(100,2) as integer: 'Array for coordinates, 100 = limit
i = 1 M = InputBox("Maximum number of cases", , 0)
Do Until i = M
Cells(i, 1) = InputBox("x coordinates for cases", , "")
O(i, 1) = Cells(i, 1)
Cells(i, 2) = InputBox("y coordinates for cases", , "")
O(i, 2) = Cells(i, 2)
i = i + 1
Loop
I would appreciate any help you could give me.
Last edited: