1 / 3

Private Sub CommandButton1_Click() Dim n As Integer For n = 1 To 20

A los 20 números al azar, agregarle en la columna siguiente un mensaje que informe si el número es múltiplo de 5. LLenar una tabla de 10 x 10 con la palabra "Bestia". Private Sub CommandButton2_Click() Dim n As Integer Range("a23").Cells(n, 1) = " bestia "

eric-grimes
Télécharger la présentation

Private Sub CommandButton1_Click() Dim n As Integer For n = 1 To 20

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A los 20 números al azar, agregarle en la columna siguiente un mensaje que informe si el número es múltiplo de 5. LLenar una tabla de 10 x 10 con la palabra "Bestia" Private Sub CommandButton2_Click() Dim n As Integer Range("a23").Cells(n, 1) = "bestia" Range("a23").Cells(n, 2) = "bestia" Range("a23").Cells(n, 3) = "bestia" Range("a23").Cells(n, 4) = "bestia" Range("a23").Cells(n, 5) = "bestia" Range("a23").Cells(n, 6) = "bestia" Range("a23").Cells(n, 7) = "bestia" Range("a23").Cells(n, 8) = "bestia" Range("a23").Cells(n, 9) = "bestia" Range("a23").Cells(n, 10) = "bestia" Next n End Sub Private Sub CommandButton1_Click() Dim n As Integer For n = 1 To 20 Range("a1").Cells(n, 1) = Int(100 * Rnd() + 1) If Range("a1").Cells(n, 1) Mod 5 = 0 Then Range("b1").Cells(n, 1) = "esmultiplo de 5" End If Next n End Sub

  2. Ingresar en una columna 30 números enteros cualesquiera (no consecutivos) informar cuál fue el mayor de estos números. LLenar una tabla de 10 x 10 con números al azar entre 1 y 1000 e informar en una celda vacía cuántos númreros fueron mayores que 500. Private Sub CommandButton1_Click() Dim b, n, mayor As Integer For b = 1 To 10 For Z = 1 To 30 Range("a4").Cells(Z, 1) = Int(150 * Rnd - 50) If mayor < Range("a4").Cells(Z, 1) Then mayor = Range("a4").Cells(Z, 1) Next b Next Z Range("a15").Cells(1, 1) = "elmayores" & mayor End Sub Private Sub CommandButton1_Click() Dim b, n, mayor As Integer For b = 1 To 10 Range("a4").Cells(b, 1) = Int(150 * Rnd - 50) If boulay < Range("a4").Cells(b, 1) Then boulay = Range("a4").Cells(b, 1) Next b Range("a15").Cells(1, 1) = "elmayores" & boulay End Sub

  3. Ingresar en una columna 20 números enteros ( positivos y negativos) entre -100 y 100 e informar el promedio de esos números Private Sub CommandButton2_Click() Dim n, acum As Integer For n = 1 To 20 Range("a4").Cells(n, 1) = Int(-200 * Rnd + 100) acum = acum + Range("a4").Cells(n, 1) Next n Range("a21") = acum / 20 End Sub

More Related