Sub CriarTabelaFuros()
Dim NomeArquivo As String
Caminho = ThisWorkbook.Path & Application.PathSeparator
NomeArquivo = "TabelaFuros" & ".txt"
Open Caminho & NomeArquivo For Output As #1
Dim cont As Long
cont = 1
For j = 0 To (Range("C8") - 1)
For k = 0 To (Range("C10").Offset(j, 0) - 1)
If j Mod 2 = 0 Then
Range("I2").Offset(j, k) = Range("C2") + (Range("C5") * k)
Else
Range("I2").Offset(j, k) = (Range("C5") / 2) + (Range("C5") * k)
End If
Range("I20").Offset(j, k) = Range("C3") + (Range("C6") * j)
Debug.Print cont & " " & Range("I2").Offset(j, k) & " " & Range("C3") + (Range("C6") * j)
Print #1, cont & " " & Range("I2").Offset(j, k) & " " & Range("C3") + (Range("C6") * j)
cont = cont + 1
Next
Next
Close #1
End Sub
Postado : 06/01/2020 11:15 pm