student111
New Member
- Joined
- Dec 6, 2013
- Messages
- 6
Hey All,
So currently, i have a macro that requests a set of data, which it will then automatically log into a table, and initiate a few other actions. What i need however is, when the macro is run again, it will enter the new data set in the appropriate columns on the next row down, rather than rewrite the previous data. i.e, run macro once, it will fill up d1, e1, f1. When i run it again, i need it to fill d2,e2,f2. To note, there are other bits of data above and below this table, so that complicates it i think.
Anyway, if anyone could help me with this i would be really grateful!
here is the code:
So currently, i have a macro that requests a set of data, which it will then automatically log into a table, and initiate a few other actions. What i need however is, when the macro is run again, it will enter the new data set in the appropriate columns on the next row down, rather than rewrite the previous data. i.e, run macro once, it will fill up d1, e1, f1. When i run it again, i need it to fill d2,e2,f2. To note, there are other bits of data above and below this table, so that complicates it i think.
Anyway, if anyone could help me with this i would be really grateful!
here is the code:
Code:
Sub TestMacro()
Range("B" & "12").Select
ActiveCell.FormulaR1C1 = InputBox("Enter Name of Point:")
Range("c" & "12").Select
ActiveCell.FormulaR1C1 = InputBox("Enter Northing Coordinate:")
Range("d" & "12").Select
ActiveCell.FormulaR1C1 = InputBox("Enter Easting/Westing Coordinate:")
Range("e" & "12").Select
ActiveCell.FormulaR1C1 = InputBox("Enter Transition Length (Ls):")
Range("f" & "12").Select
ActiveCell.FormulaR1C1 = InputBox("Minimum Radius (Rc)")
Range("g" & "12").Select
ActiveCell.FormulaR1C1 = InputBox("Enter Central Angle (DELTA):")
Range("u" & "13").Select
ActiveCell.FormulaR1C1 = Range("B160")
Range("v" & "13").Select
ActiveCell.FormulaR1C1 = Range("C160")
Range("w" & "13").Select
ActiveCell.FormulaR1C1 = Range("D160")
Range("x" & "13").Select
ActiveCell.FormulaR1C1 = Range("E160")
End Sub