This is my code in Module1
Sub Rand() Dim ws As Worksheet Dim stRow As Long, endRow As Long, dataCol As Long Dim dispRow As Long, dispCol As Long Set ws = Sheets("Sheet1") stRow = 3 dataCol = 1 dispRow = 4 dispCol = 7 With ws endRow = .Cells(.Rows.Count, dataCol).End(xlUp).Row .Cells(dispRow, dispCol).Value = _ .Cells(Application.RandBetween(stRow, endRow), dataCol).Value End With End Sub
This code is embedded into Button 1. I'd like to add two macros to run when Button 1 was clicked:
The very first one works like a charm already; random selections.
Other two codes (Thanks Ozgrid's Carim for the last one) also work.. I tried to add / embed to codes into the Module1 but no success.
What I want to do is when clicked once, random selection will be displayed, the value is to be copied to the clipboard, and random selection cells will be copied to another sheet.
Any help would be great. Thanks in advance.