JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,535
- Office Version
- 365
- Platform
- Windows
I am working on a sub that will generate a list of random numbers of variable length. I want it to write those values to the calling sheet starting at a named cell and then (re)define that range.
For example: I have assigned the name "Hdr" to D5 and "Count" to D4. Count (D4) currently contains "10". I have a button control that will call my Sub named "DoIt". DoIt will read the value in Count (10) and then generate 10 random numbers. Now I want DoIt to save those 10 values in D6:D15 (offset(Hdr,1,0)ffset(Hdr,Count+1,0). Then I want it to assign the name "NewData" to D6:D15.
Can someone help me with the code to do that?
Thanks
For example: I have assigned the name "Hdr" to D5 and "Count" to D4. Count (D4) currently contains "10". I have a button control that will call my Sub named "DoIt". DoIt will read the value in Count (10) and then generate 10 random numbers. Now I want DoIt to save those 10 values in D6:D15 (offset(Hdr,1,0)ffset(Hdr,Count+1,0). Then I want it to assign the name "NewData" to D6:D15.
Can someone help me with the code to do that?
Thanks