superior147
New Member
- Joined
- Nov 9, 2005
- Messages
- 1
This is my first post so forgive me if I omit anything I should have included.
I am trying to write a simple macro that, on the click of a button, will use an input box to record a percentage value and then will apply it to a range of cells.
I have achieved this much, when using a fixed range of cellls (as follows)...
Sub Set_Target_Rate()
target = InputBox("Set target rate (%):", "Target Rate")
Range("G7:G60000").Select
Selection.FormulaR1C1 = target / 100
End Sub
But what I want to be able to do is to say, for example, fill column G with the percentage value only as far as there is data in column F. I have been trying to use a count of the values in column F and use this as my end reference for my G range (if that makes sense?), but it's not working.
Any advice would be gratefully appreciated, many thanks....
I am trying to write a simple macro that, on the click of a button, will use an input box to record a percentage value and then will apply it to a range of cells.
I have achieved this much, when using a fixed range of cellls (as follows)...
Sub Set_Target_Rate()
target = InputBox("Set target rate (%):", "Target Rate")
Range("G7:G60000").Select
Selection.FormulaR1C1 = target / 100
End Sub
But what I want to be able to do is to say, for example, fill column G with the percentage value only as far as there is data in column F. I have been trying to use a count of the values in column F and use this as my end reference for my G range (if that makes sense?), but it's not working.
Any advice would be gratefully appreciated, many thanks....