Hello,
I have made this very basic macro to transfer certain information to Sheet2 from Sheet1 with IF/Then statements:
Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+M
'
Range("A4").Select
ActiveCell.FormulaR1C1 = _
"=IF('Credit Card Expense'!R[8]C[4]=""6575"",'Credit Card Expense'!R[8]C,""0"")"
Range("A4").Select
Selection.Copy
Range("A5:A42").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-14
Range("B4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=IF('Credit Card Expense'!R[8]C[3]=""6575"",'Credit Card Expense'!R[8]C,""0"")"
Range("B4").Select
Selection.Copy
Range("B5:B41").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-8
Range("G4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=IF('Credit Card Expense'!R[8]C[-2]=""6575"",'Credit Card Expense'!R[8]C[-1],""0"")"
Range("G4").Select
Selection.Copy
Range("G5:G41").Select
ActiveSheet.Paste
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
__________________________________________________________________
I would like to figure out how to make it VBA code so that it runs this process, but also eliminates all of the rows that inevitably will be filled with "0"'s when the statement is False. Help? Thanks!
I have made this very basic macro to transfer certain information to Sheet2 from Sheet1 with IF/Then statements:
Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+M
'
Range("A4").Select
ActiveCell.FormulaR1C1 = _
"=IF('Credit Card Expense'!R[8]C[4]=""6575"",'Credit Card Expense'!R[8]C,""0"")"
Range("A4").Select
Selection.Copy
Range("A5:A42").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-14
Range("B4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=IF('Credit Card Expense'!R[8]C[3]=""6575"",'Credit Card Expense'!R[8]C,""0"")"
Range("B4").Select
Selection.Copy
Range("B5:B41").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-8
Range("G4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=IF('Credit Card Expense'!R[8]C[-2]=""6575"",'Credit Card Expense'!R[8]C[-1],""0"")"
Range("G4").Select
Selection.Copy
Range("G5:G41").Select
ActiveSheet.Paste
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
__________________________________________________________________
I would like to figure out how to make it VBA code so that it runs this process, but also eliminates all of the rows that inevitably will be filled with "0"'s when the statement is False. Help? Thanks!