Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the following Excel spreadsheet to automate the task of assigning random numbers to the squares, and selecting the winning square when the cow fails

Create the following Excel spreadsheet to automate the task of assigning random numbers to the squares, and selecting the winning square when the cow fails to deliver. Whenever the user clicks the "Go" button, your VBA program should assign new random numbers to the cells in the worksheet and also randomly select the winning cell and change its background color to red (or some other color).

image text in transcribed

1) You may use formulas in the worksheet to create the row and column headings in the table. However, there should not be any other formulas in the worksheet. All the random numbers should be generated in VBA and placed in the cells as numeric constants (not cell formulas). 2) In VBA, numbers between 1 and 500 can be randomly generated via: 1 + Int(Rnd * 500)) 3) You will need to figure out how to make VBA loop through the 500 cells in the range containing the numbers. While the lectures in Unit 5 describe the Cells( ) collection of a range object as requiring two arguments to specify a row and column (like Cells(r, c)), you can also use a single argument (like Cells(n)) to refer to the nth cell in a range. 4) There are a variety of ways to approach this problem. One way is to first fill the range sequentially with the integers from 1 to 500. Then, you could go to each cell (one at a time), generate a random cell number between 1 and 500 and then swap the value in the current cell with the value that is in whatever cell number you generate randomly.

File Data Add-Ins Risk Solver Platform Home Insert Page Layout Formulas B C DE F G H 1 J Review View Developer L M N 0 P Q R A K S T U V w X Y ZAA AB Go UL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 214 142 386 420 491 350 266 369 483 466 256 495 419 330 229 465 440 72231 425 283 490 244197 117 2 119 77 167 478 389 347 217 334 404 154 367 302 363 297 484 448 102 185 118 234 251 335 27 101 29 3 2 209158 145 | 427 202493365 254377 116147 11 443 76 447230 45 84 123252487 381 476 54 4 86 177 430299 150 207 298 449 70438 204 26 68 394 134 499 23 82 80 279454 78 339 371 143 5 220 439 130 325 415163 112 89 135 196133291 387 461 345 212 22498 59 259 474 4 63307257 6 12 179 215 471 171 346 362 96 162 450 462 208 236 137 326 489 370 342 395 286 93 460 319 290 337 7 47 203 373 42232424 21 267 216 160 406 5 414 416105 94 238 341 374 268 380 16 144 | 288464 8 422 46 273 60 122148 73 8 379233 336 258 104 281 180 410 262 31 418354 14 146 81 492 428 9 71 340127 338 479 277 3 323 303 85 401 301 459 30 437 228 182 472 398 28 411 69 284 455 456 10 15 413 321 99 436 235 166 432 51 128 35 384 170 468 66 198 98261 75 155 18366 218 358 24 11 441 382 316 275 343 211 348 322 378 108 332 20 496 7 121 446 157 255 270 269 372 90 368 376 391 12138 83 356 312 264 433 52 152 407 396 131 125 | 480 328 488 13 17 293 126 250 393 224 140458242 131 25 431 246 311 481 44 79 188 165 417 295 353 161 248 285 39 435 114 194 100 50 62 253 329 14 103 95 305 445 181 315 199 500 482 129 263159 149 61429 247 19 320 453 271 385 74 227 109 56 15 324 318 206 67 292 360 239 451 190 388 168 34 306 139 237 470 333 9 226 141 110 289452 409 16 486 308 352 314 434 497 272 300 327 349 169494 115 225 403 364 473 187 124 274 260 240 41 309 33 17193 423 36 331 151 87 97 399 280 153 294 120 132467 58 183 178359 | 405 136 397 426 390 172 38 18195408 304 310 191 205 219 392 282 40 400 184 192 317175 357 243 245 469 344 442 221 | 223 | 249 19287241 174 106 10 107 1 457 164 113 201 49 156 463 210 444 | 402 485 296 173 186 213 92375 6 20176 57 32421 65 351 43 477 313 53 355 265 383 222 412 276 475 189361 55 91 200278 111 48 64 File Data Add-Ins Risk Solver Platform Home Insert Page Layout Formulas B C DE F G H 1 J Review View Developer L M N 0 P Q R A K S T U V w X Y ZAA AB Go UL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 214 142 386 420 491 350 266 369 483 466 256 495 419 330 229 465 440 72231 425 283 490 244197 117 2 119 77 167 478 389 347 217 334 404 154 367 302 363 297 484 448 102 185 118 234 251 335 27 101 29 3 2 209158 145 | 427 202493365 254377 116147 11 443 76 447230 45 84 123252487 381 476 54 4 86 177 430299 150 207 298 449 70438 204 26 68 394 134 499 23 82 80 279454 78 339 371 143 5 220 439 130 325 415163 112 89 135 196133291 387 461 345 212 22498 59 259 474 4 63307257 6 12 179 215 471 171 346 362 96 162 450 462 208 236 137 326 489 370 342 395 286 93 460 319 290 337 7 47 203 373 42232424 21 267 216 160 406 5 414 416105 94 238 341 374 268 380 16 144 | 288464 8 422 46 273 60 122148 73 8 379233 336 258 104 281 180 410 262 31 418354 14 146 81 492 428 9 71 340127 338 479 277 3 323 303 85 401 301 459 30 437 228 182 472 398 28 411 69 284 455 456 10 15 413 321 99 436 235 166 432 51 128 35 384 170 468 66 198 98261 75 155 18366 218 358 24 11 441 382 316 275 343 211 348 322 378 108 332 20 496 7 121 446 157 255 270 269 372 90 368 376 391 12138 83 356 312 264 433 52 152 407 396 131 125 | 480 328 488 13 17 293 126 250 393 224 140458242 131 25 431 246 311 481 44 79 188 165 417 295 353 161 248 285 39 435 114 194 100 50 62 253 329 14 103 95 305 445 181 315 199 500 482 129 263159 149 61429 247 19 320 453 271 385 74 227 109 56 15 324 318 206 67 292 360 239 451 190 388 168 34 306 139 237 470 333 9 226 141 110 289452 409 16 486 308 352 314 434 497 272 300 327 349 169494 115 225 403 364 473 187 124 274 260 240 41 309 33 17193 423 36 331 151 87 97 399 280 153 294 120 132467 58 183 178359 | 405 136 397 426 390 172 38 18195408 304 310 191 205 219 392 282 40 400 184 192 317175 357 243 245 469 344 442 221 | 223 | 249 19287241 174 106 10 107 1 457 164 113 201 49 156 463 210 444 | 402 485 296 173 186 213 92375 6 20176 57 32421 65 351 43 477 313 53 355 265 383 222 412 276 475 189361 55 91 200278 111 48 64

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Accounting questions