Random Highlight only 1 in the each row

Kishan

Well-known Member
Joined
Mar 15, 2011
Messages
1,648
Office Version
  1. 2010
Platform
  1. Windows
Using Excel 2000</SPAN></SPAN>
Hi,
</SPAN></SPAN>

I need a VBA, which can highlight 1 character out of 1X2 in the each row so far each time 14 total are selected within the 14
</SPAN></SPAN>

Example..

Book1
ABCDEFG
1
2
3
4
5
611X2
721X2
831X2
941X2
1051X2
1161X2
1271X2
1381X2
1491X2
15101X2
16111X2
17121X2
18131X2
19141X2
20
21
22
23
Sheet1


Thank you in advance
</SPAN></SPAN>

Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Last edited:
Kishan lists his version at the top of his first messages... he is using XL2000.

Thanks @Rick Rothstein, I did not see it.

Hi @Kishan, Version 2000 does not support the function.

RANDBETWEEN function
Excel for Office 365 Excel for Office 365 for Mac Excel for the web Excel 2019 Excel 2016 Excel 2019 for Mac Excel 2013 Excel 2010 Excel 2007 Excel 2016 for Mac Excel for Mac 2011 Excel Starter 2010

https://support.office.com/en-us/article/randbetween-function-4cc7f0d1-87dc-4eb7-987f-a469ab381685
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I cannot get it to move the colors back and forth in any reasonable time frame, but maybe this will be acceptable to you...
Code:
Sub RandomHighlight()
      Application.Wait Now + 0.00001
  Next
End Sub
Rick, yes adding to code wait now it is much better, thank you so much</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Kishan :)
</SPAN></SPAN>
 
Last edited:
Upvote 0
See if either of these is what you mean. If so, you can experiment with changing the 'Const' lines near the start of each code to get the desired effect.

Rich (BB code):
Sub Rnd_Highlights_1()
        For j = 1 To Delay: Next j
    Next i
  Next rw
End Sub


Rich (BB code):
Sub Rnd_Highlights_2()
  Dim rw As Range, rng As Range
  Dim i As Long, j As Long, k As Long, colnew As Long
  
  Const CycleStart As Long = 3
  Const CycleSize As Long = 4
  Const Delay As Long = 90000000
  
  End Sub
Peter, both the code is working very nicely, these move give bit sensation that like a code is trying to find top random I like the code.</SPAN></SPAN>

I do appreciate your help
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Kishan :)
</SPAN></SPAN>
 
Upvote 0
Peter, both the code is working very nicely, these move give bit sensation that like a code is trying to find top random I like the code.</SPAN></SPAN>

I do appreciate your help
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Kishan :)
</SPAN></SPAN>
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,807
Messages
6,121,679
Members
449,047
Latest member
notmrdurden

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top