segue abaixo o codigo da Macro na qual desejo inserir o codigo pra ignorar os valores nulos e formulas:
Sub GeraCombinacoes()
Dim lElementos As Long
li = 9
ci = Cells(1, "d").Column
Cf = ci + Cells(4, "b").Value2 - Cells(1, "ha").Value
lf = Cells(Rows.Count, ci).End(xlUp).Row + 1
If lf < li Then lf = li
Range(Cells(li, ci), Cells(lf, Cf)).ClearContents
fixs = Cells(1, "ah").Value2
r = li
cw = ci + fixs
colun = Cells(4, "b").Value2 - fixs
Coluno = Range("dezenas").Value2 'tabela de valores
For L = 1 To UBound(Coluno, 1)
For car = 1 To UBound(Coluno, 2)
vx = Coluno(L, car)
If vx > 0 And vx < 101 Then
k = k & "|" & vx
End If
Next
Next
vj = Split(k, "|")
lElementos = UBound(vj) - LBound(vj) '+ 1
Combinacao lElementos, colun, 1
Range(Cells(li, cw), Cells(r, cw + colun - 1)).Value2 = Range(Cells(li, cw), Cells(r, cw + colun - 1)).Value2
If fixs > 0 Then Range(Cells(li, ci), Cells(r - 1, Cells(1, "d").Column + fixs - 1)).Value2 = _
Range("D1", Cells(1, Cells(1, "w").End(xlToLeft).Column)).Value2
End Sub
Postado : 16/06/2015 8:10 am