Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    [VB6] Comandi VB6 su un foglio Excel

    ho creato una macro su excel che mi incolla speciale una serie di valori presi da pagine di internet, e mi sono detto perchè non usare VB6.

    bene mi creo il form, il comando e ci inserisco la macro e mi metto un foglio di excel nello stesso form.

    il problema sta quando clicco il pulsante....non succede nulla, ed immagino perchè non ho scritto nella macro di scrivere i dati nel foglio excel, cosa implicita in Excel.

    ho fatto vari tentativo ma non ci riesco a fare un incolla speciale nella cella A1.....ed in generale non riesco a fargli scrivere nulla nelle celle che indico...


    HELP, ho cercato su internet ma e come fare un caccia alle streghe

  2. #2
    help

  3. #3
    Perchè non posti il codice che hai scritto?
    Chi non cerca trova.

  4. #4
    è un po lunghetta...funziona su Excel ma non nei form di VB6 perchè non specificato bene la cella del foglio excel

    Sub Macrovalerio()
    '

    '

    ' Trasforma il contenuto di una cella da formula a valore

    Application.CutCopyMode = False
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Application.CutCopyMode = False
    End Sub


    Sub Valerio()


    Dim a(5), b(8), p(8), f(8)
    ' Rows("1:20").Select
    ' Selection.Delete Shift:=xlUp
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Selection.Copy
    Range("A17").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    With Selection.Interior
    .ColorIndex = 6
    .Pattern = xlSolid
    End With
    Rows("1:16").Select
    Selection.Delete Shift:=xlUp
    Columns("A").Select
    Columns("A").EntireColumn.AutoFit
    Range("A1").Select
    a(1) = Cells(2, 2).Value
    a(2) = Cells(3, 2).Value
    a(3) = Cells(4, 2).Value
    a(4) = Cells(2, 4).Value
    a(5) = Cells(3, 4).Value
    b(1) = "eccellente"
    b(2) = "buono"
    b(3) = "accettabile"
    b(4) = "insufficiente"
    b(5) = "debole"
    b(6) = "scarso"
    b(7) = "tremendo"
    b(8) = "disastroso"
    p(1) = 1500
    p(2) = 1000
    p(3) = 500
    p(4) = 250
    p(5) = 125
    p(6) = 0
    p(7) = -62.5
    p(8) = -125
    f(1) = 1.2
    f(2) = 1.1
    f(3) = 1
    f(4) = 0.9
    f(5) = 0.8
    f(6) = 0.7
    f(7) = 0.6
    f(8) = 0.5
    k = 0
    For i = 1 To 5
    For j = 1 To 8
    If a(i) = b(j) Then k = k + p(j)
    Next
    Next
    For j = 1 To 8
    If Cells(1, 2).Value = b(j) Then k = k * f(j)
    Next
    Cells(8, 1).Value = "Punteggio"
    Cells(8, 2).Value = k
    Cells(9, 1).Value = "Forma"
    For j = 1 To 8
    Cells(8 + j, 2) = b(j)
    Cells(8 + j, 3) = k * f(j)
    Next
    Range("C9:C16").Select
    Selection.Style = "Comma"
    Selection.NumberFormat = "_-* #,##0.0_-;-* #,##0.0_-;_-* ""-""??_-;_-@_-"
    Selection.NumberFormat = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-"
    With Selection.Interior
    .ColorIndex = 35
    .Pattern = xlSolid
    End With
    Range("B9:C16").Select
    With Selection.Borders(xlInsideHorizontal)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = xlAutomatic
    End With
    Range("A1").Select
    End Sub

  5. #5
    ari-help

  6. #6

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.