I need help creating some VBA code in excel. I have this code below but it isn't running and I'm not sure how to fix it.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

I need help creating some VBA code in excel. I have this code below but it isn't running and I'm not sure how to fix it.

Post by answerhappygod »

I need help creating some VBA code in excel. I have this code below but it isn't running and I'm not sure how to fix it. Please help. I'm trying to create a macro that randomly selects multiple cells from the ID column and inputs a unique random 4-digit number. Just wanted to clarify in case it wasn't very clear by the code. The EMPL_ID column has 1001 rows in it by the way
I Need Help Creating Some Vba Code In Excel I Have This Code Below But It Isn T Running And I M Not Sure How To Fix It 1
I Need Help Creating Some Vba Code In Excel I Have This Code Below But It Isn T Running And I M Not Sure How To Fix It 1 (111.55 KiB) Viewed 56 times
I Need Help Creating Some Vba Code In Excel I Have This Code Below But It Isn T Running And I M Not Sure How To Fix It 2
I Need Help Creating Some Vba Code In Excel I Have This Code Below But It Isn T Running And I M Not Sure How To Fix It 2 (164.49 KiB) Viewed 56 times
Sub RandomEMPLID () 'RandomEMPLID Macro Keyboard Shortcut: Ctrl+Shift+Q Dim RandomEmp, Column1 Column1 = 1 For i = 1 To 30 RandomEmp = WorksheetFunction. RandBetween (2000, 9999) Cells (randomNum, Column1) = Int ((2 - 9999 + 1) * Rand +9999) Cells (randomNum, Column1). Select Next i End Sub
M10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 A B с D E EMPL ID EMPL PER MRC PER ORG PER TRADE 6536 ROGE 15 * 3533 ESTRA 3876 KIM R 2413 MARC 4612 MASS 5652 WYNN 3635 CASH 9909 CANCI 7067 FOSTE 4557 ROME 4149 LANE 6539 GARCI 3306 VILLEG 6218 SOLON 5686 SANDI 4087 GARCI 4821 BROW 2089 HELLIN 4692 HINES 4779 LANGI 3225 PEREZ 8666 JORDA 17 X 18 19 20 21 22 23 15 * 15 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * 15 * fx * * * * * * * * * * * * * * * * * * * * * SampleData4V1 062720221043 + F
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply