Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-21-2021, 01:51 AM
Purfleet Purfleet is offline Randbetween function embedded in a macro HELP Windows 10 Randbetween function embedded in a macro HELP Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

Try something like this

Code:
Sub Randomly_generate_a_number_between_1_and_10_inclusive()
'
' Macro1 Macro

    Range("b:b").Interior.Color = xlNone
    
    randnum = WorksheetFunction.RandBetween(1, 10)
'
    Range("D2") = randnum
    
    Range("A:A").Find(what:=randnum, LookIn:=xlValues, lookat:=xlWhole).Offset(0, 1).Interior.Color = vbYellow
       
    
End Sub
Attached Files
File Type: xlsm Copy of RECAP Project_Purfleet.xlsm (23.2 KB, 6 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Randbetween function embedded in a macro HELP RANDBETWEEN question derohanes Excel 3 01-25-2019 09:38 AM
Randbetween function embedded in a macro HELP Calculating bonus in an embedded IF function Yde1203 Excel Programming 2 07-22-2018 08:24 AM
RandBetween for PowerPoint excelledsoftware PowerPoint 1 09-19-2014 11:32 PM
Randbetween function embedded in a macro HELP RandBetween Formula Help acbh Excel 1 09-12-2013 06:51 PM
Randbetween function embedded in a macro HELP word macro that reformats embedded links in a doc EricT Word VBA 7 09-12-2012 04:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft