Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Carlton Martinez   on Jan 21 In MS Office Category.

  
Question Answered By: Monique Perry   on Jan 21

Let's say your list  is in column  A, starting in row 10.
I'd use:
StartRow = 10
RowCnt = Application.WorksheetFunction.CountA(Range("A" & StartRow & ":A65000"))

This will count the number of non-blank cells  in column A from row 10 to 65000
Keep in mind that if there are any blank rows in the middle of the data, it will
NOT
count it, and the number will be off.
Next use:

Randomize 'Initializes the
RandRow = Int((RowCnt + 1) * Rnd) + StartRow

this should give  you the Row Number of a random  row in your range.

Can you put it together from here?

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Select random cell in list and highlight contents Or get search suggestion and latest updates.


Tagged: