di matzap » 23/07/13 15:49
tasto destro, assegna macro, mi dice casella di controllo 236 ( c'è un altro modo per vedere il nome?)
dovrebbe essere un controllo modulo,
il modulo dovrebbe essere modulo8, generale, non so bene di quale riga parli e scusa se dico cavolate.
il codice è un pò lungo però eccolo ( le righe in questione sono in grassetto e dovrei sostituire le prime due con la terza.
nuovo rapportino Macro
' Macro registrata il 28/01/2011 da a963546
'
' Scelta rapida da tastiera: CTRL+p
'
ActiveSheet.Unprotect
Range("A10:K19").Select
Selection.ClearContents
Range("S21:X21").Select
Selection.ClearContents
Range("T20") = True
Range("A10").Select
ActiveSheet.PasteSpecial Format:="Testo", Link:=False, DisplayAsIcon:=False
Range("G10:G19").Select
Selection.Copy
Range("Z10:Z19").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("Z10:Z19").Select
Cells(10, 26).Select
For x = 10 To 19
If Cells(x, 26) = "" Then Exit For
If Len(Cells(x, 26)) = 17 Then ParteDaEstrarre = 3
If Len(Cells(x, 26)) = 18 Then ParteDaEstrarre = 4
Cells(x, 26) = Mid(Cells(x, 26), 12, ParteDaEstrarre)
If Len(Cells(x, 26)) < 17 Then Cells(x, 26) = Cells(x, 26)
Next x
Range("G10:G19").Select
Selection.TextToColumns Destination:=Range("G10"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(10, 9)), TrailingMinusNumbers:=True
' per cancellare i messaggi
'For x = 10 To 17
' Range("AA" & x).Select
' Selection = False
'Next x
Range("M28").Select
Selection.ClearContents
Range("AB27").Select
Selection = False
Range("AB28").Select
Selection = False
Range("AB29").Select
Selection = False
'Sheet("mes-Bernotti-Gautschi ").CheckBox236 = False ActiveSheet.OptionButton6.Value = True
Range("W4").Select
Selection = True
' per verificare uso macro
'If Application.WorksheetFunction.CountIf(Sheets("verifica").Range("A1:A1000"), "nuovo_rapportino") = 0 Then
'Sheets("verifica").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) = "nuovo_rapportino"
'End If
ActiveSheet.Protect, DrawingObjects:=True, contents:=True, Scenarios:= _
True, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True
Range("W11:W19").Select
Selection.ClearContents
Range("W10").Select
ActiveCell.FormulaR1C1 = "1"
Range("AB27").Select
Selection.ClearContents
Range("J10").Select
Range("A10").Select
'COMMENTO: per rendere invisibile una casella che esiste e cancellarne il contenuto
If ActiveSheet.Shapes("messaggio generico").Visible = True Then
ActiveSheet.Shapes.Range(Array("messaggio generico")).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = ""
ActiveSheet.Shapes("messaggio generico").Visible = False
End If
End Sub
excel 2010