Microsoft Excel Training

Basic Excel

Trending Questions and Lessons

Follow 35,208 Followers

Feed

Ask a Question

All

Lessons

Discussion

Overview

Lessons 15

Total Shares  

Lesson Posted on 25/07/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Advanced Excel IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel IT Courses/MS Office Software Training/Microsoft Excel Training/Excel VBA & Macro Training +1 IT Courses/MS Office Software Training/Microsoft Excel Training less

VBA Tip: Print Random Numbers In A Selected Range

Karthik Dale

II have 8 years of Data Analytics Experience. I have extensive experience in wide range of Excel Automation...

Let’s say you want to print some random numbers in a selected range then you can use below Macro. Sub Print_Randomnumbers() Dim myrng As Range For Each myrng In Selection myrng.Value = Application.WorksheetFunction.Int(Rnd * 1000) Next myrng End Sub How it works? It's a for each loop... read more

Let’s say you want to print some random numbers in a selected range then you can use below Macro.

Sub Print_Randomnumbers()

Dim myrng As Range

For Each myrng In Selection

    myrng.Value = Application.WorksheetFunction.Int(Rnd * 1000)

Next myrng

End Sub

How it works?

  1. It's a for each loop which loops through each cell in the selection.
  2. VBA function Rnd populate random number from 0 to 1.
  3. If you want to print numbers up to the range of 1000 then multiply Rnd with 1000.
  4. . Int function pulls the integer value from Rnd*1000.

 

read less
Comments
Dislike Bookmark Share

Answered on 16/09/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel

How to learn Excel online for free?

Prabhas Kumar Panda

Advanced Excel Training Specialist

Hi Rajan, There are lot of sites who shares the knowledge free of cost in terms videos, GIF images and static tutorials. Few sites where lot of users learnt and recommended are: www.mr.excel.com www.chandoo.org www.lynda.com www.triumphexcel.com
Answers 1 Comments 1
Dislike Bookmark Share

Asked on 08/07/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel

 

Answer

Asked on 08/07/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel

What is Excel?  

Answer

Asked on 08/07/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel

How to use MS Excel?  

Answer

Asked on 08/07/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel

How to use Excel?  

Answer

Top Contributors

Connect with Expert Tutors & Institutes for Basic Excel

Asked on 08/07/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel

What is Microsoft Excel?  

Answer

Asked on 08/07/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel

How to learn Excel online free  

Answer

Asked on 08/07/2017 IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel

What to learn in Excel?  

Answer

Lesson Posted on 30/05/2017 IT Courses/MS Office Software Training/Microsoft Excel Training IT Courses/MS Office Software Training/Microsoft Excel Training/Advanced Excel IT Courses/MS Office Software Training/Microsoft Excel Training/Basic Excel +1 IT Courses/MS Office Software Training/Microsoft Excel Training/Excel VBA & Macro Training less

Rand() Function

Saburudeen Ma

I started my teaching carrier since i was doing my UG, as part time faculty in a computer institute....

Purpose: Get a random number between 0 and 1. Return Value: Any decimal number between 0 and 1. Syntax: =RAND() Usage: RAND() function will returns a number between 0 and 1. For example, = RAND() will generate a number like 0.554533. RAND() calculates a new value each time the worksheet is calculated.... read more

Purpose:

Get a random number between 0 and 1.

Return Value:

Any decimal number between 0 and 1.

Syntax:

=RAND()

Usage:

RAND() function will returns a number between 0 and 1. For example, = RAND() will generate  a number like 0.554533.

RAND() calculates a new value each time the worksheet is calculated. To stop random numbers from being updated, copy the cells that contain RAND to the clipboard, then use Paste Special -> Values to convert to text.

To get a random number  that doesn’t  change when the worksheet is calculated, enter = RAND() in the formulas bar and then press F9 to convert the formula in to its result.

To generate a set of random numbers in multiple cells, select the cells, enter RAND() and press ctrl+enter.

To generate a random number  between a  and b, use this formula : rand()*(b-a)+a

read less
Comments
Dislike Bookmark Share

About UrbanPro

UrbanPro.com helps you to connect with the best Microsoft Excel Training classes in India. Post Your Requirement today and get connected.

x

Ask a Question

Please enter your Question

Please select a Tag

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 25 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 6.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more