![]() |
|
|
|
#1
|
|||
|
|||
|
It needs a macro
To generate the random number use this formula: Number =Int((highest number in range - one less that lowest number)*rnd + lowest number in range) EXAMPLE number between 10 and 1000 Code:
Number=Int(991*rnd)+10 '991 is 1000 -9 |
|
#2
|
|||
|
|||
|
Hi John, I did find this one and it works great:
Sub UpdateRandomNumber(oSh As Shape) oSh.TextFrame.TextRange.Text = CStr(Random(12)) SlideShowWindows(1).View.GotoSlide (SlideShowWindows(1).View.Slide.SlideIndex) End Sub Function Random(High As Long) As Long Randomize Random = Int((High * Rnd) + 1) End Function No I need to find a way to get this randomly generated number to interact with other numbers. This is an electrical exersize and the formulas are based on Ohms law. The circuit will have 120 V applied, and two resistors in series, the reistance of one resistor is the Randomly generated number and the other I would keep at 100 ohms at this time. so the formulas/results that I would be looking to have work on the screen would be: 1. Total resistance - Randomly generated number plus 100 2. Current - 120 divided by Total resistance 3. Volt drop 1, which is the resistor having the Randoml generated number - Current times the randomly generated number 4. Volt drop 2, which is my static resistor of 100 ohms - Current time 100 I am trying to learn VBA and this would go a long way to doing that as well as a spring board to other similiar projects. |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Macro to recap data of same numbers | Jasa P | Word VBA | 0 | 06-28-2012 02:41 AM |
Formatting changing randomly
|
Franuzz | Word | 1 | 07-14-2011 04:12 PM |
| black text randomly changing to white when run macro | G DeBree | PowerPoint | 0 | 03-16-2011 09:23 AM |
| Randomly delayed emails | Colinest84 | Outlook | 1 | 01-14-2011 02:32 AM |
| Documents Randomly Corrupting | the IT Guy | Word | 0 | 02-06-2009 09:11 AM |