Sub prova_bool()
'
' prova_bool Macro
'
'
Sheets("Foglio1").Select
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
' Conta le variabili scritte sulla colonna A
N_Var = Selection.Rows.Count
Sheets("Foglio2").Select
Rig = 2 ^ N_Var
For i = 1 To N_Var
x = 2 ^ i
y = Rig / x
Range(Cells(1, i), Cells(Rig / x, i)).Select
Selection.Value = "1"
Range(Cells(Rig / x + 1, i), Cells(Rig / x + y, i)).Select
Selection.Value = "0"
Cells(1, i).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
copia = Selection.Rows.Count
Range(Cells(1, i), Cells(Rig, i)).Select
ActiveSheet.Paste
Next
End Sub
|