HumbertoCS
16-11-2011 02:23:05
Olá pessoal!
Alguém sabe confirmar se há diferença entre o código das macros e do Excel VBA?
Caso afirmativo, gostaria de saber é possível converter a codificação da macro abaixo em vba... Esta macro transfere os dados de uma planilha para meu banco de dados em outra plan, ELIMINANDO nesta transferência as células de valores nulos.
Mauro, meu mestre,
se vc. estiver lendo esta mensagem, como sempre conto com sua sabedoria... 
[]s
Sub saidaestoque_lancar()
'
' saidaestoque_lancar Macro
' Macro gravada em 15/11/2011 por Humberto Costa Santana
'
' Atalho do teclado: Ctrl+s
'
Application.Goto Reference:="lancamento"
Selection.Copy
Sheets("SAIDA_ESTOQUE").Select
Application.Goto Reference:="R2C1"
Selection.Insert Shift:=xlDown
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlNotEqual, _
Formula1:="=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlRight)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
Selection.FormatConditions(1).StopIfTrue = False
Range("A2:C2").Select
Selection.Font.Bold = False
Selection.Font.Bold = True
Application.Goto Reference:="coluna_QTD"
Selection.Replace What:="0", Replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Application.Goto Reference:="coluna_QTD"
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
ActiveWorkbook.Save
End Sub
Alguém sabe confirmar se há diferença entre o código das macros e do Excel VBA?
Caso afirmativo, gostaria de saber é possível converter a codificação da macro abaixo em vba... Esta macro transfere os dados de uma planilha para meu banco de dados em outra plan, ELIMINANDO nesta transferência as células de valores nulos.
Mauro, meu mestre,
[]s
Sub saidaestoque_lancar()
'
' saidaestoque_lancar Macro
' Macro gravada em 15/11/2011 por Humberto Costa Santana
'
' Atalho do teclado: Ctrl+s
'
Application.Goto Reference:="lancamento"
Selection.Copy
Sheets("SAIDA_ESTOQUE").Select
Application.Goto Reference:="R2C1"
Selection.Insert Shift:=xlDown
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlNotEqual, _
Formula1:="=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlRight)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.TintAndShade = 0
.Weight = xlThin
End With
Selection.FormatConditions(1).StopIfTrue = False
Range("A2:C2").Select
Selection.Font.Bold = False
Selection.Font.Bold = True
Application.Goto Reference:="coluna_QTD"
Selection.Replace What:="0", Replacement:="", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Application.Goto Reference:="coluna_QTD"
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
ActiveWorkbook.Save
End Sub