Jason Gauthier
New Member
- Joined
- Sep 10, 2019
- Messages
- 3
Hello,
I am new to VBA but trying to learn. I am trying to have a sheet that has 2 Macros, the 2nd Macro will send the data to an IE webpage, this part I have done. I Recorded my Macro to copy values from one sheet to another and do some multiplication, this is where I get stuck, the Webpage cannot be sent zeros, and all the research I have done on Macros to remove zeros does not seem to work as there is a formula in the cell not a zero. Looking for coding to work after each multiply that if it equaled zero it would delete the row. Any help would be very appreciated.
Sub Copy()
'
' Copy Macro
'
Worksheets("Aldi Sheet").Rows(6).Delete Shift:=xlShiftUp
Range("A1").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[5]C[1]"
Range("B1").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[5]C[-1]"
Range("B2").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[1]C[1]"
Range("B3").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!RC[2]"
Range("B4").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-1]C[3]"
Range("B5").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-2]C[4]"
Range("B6").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-3]C[5]"
Range("B7").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-4]C[6]"
Range("B8").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-5]C[7]"
Range("B9").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-6]C[8]"
Range("B10").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-7]C[9]"
Range("B11").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-8]C[10]"
Range("B12").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-9]C[11]"
Range("C2").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[4]C*80"
Range("C3").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[3]C[1]*80"
Range("C4").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[2]C[2]*4"
Range("C5").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[1]C[3]*80"
Range("C6").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!RC[4]*80"
Range("C7").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-1]C[5]*6"
Range("C8").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-2]C[6]*6"
Range("C9").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-3]C[7]*6"
Range("C10").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-4]C[8]*6"
Range("C11").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-5]C[9]*6"
Range("C12").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-6]C[10]*6"
Range("C13").Select
End Sub
I am new to VBA but trying to learn. I am trying to have a sheet that has 2 Macros, the 2nd Macro will send the data to an IE webpage, this part I have done. I Recorded my Macro to copy values from one sheet to another and do some multiplication, this is where I get stuck, the Webpage cannot be sent zeros, and all the research I have done on Macros to remove zeros does not seem to work as there is a formula in the cell not a zero. Looking for coding to work after each multiply that if it equaled zero it would delete the row. Any help would be very appreciated.
Sub Copy()
'
' Copy Macro
'
Worksheets("Aldi Sheet").Rows(6).Delete Shift:=xlShiftUp
Range("A1").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[5]C[1]"
Range("B1").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[5]C[-1]"
Range("B2").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[1]C[1]"
Range("B3").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!RC[2]"
Range("B4").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-1]C[3]"
Range("B5").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-2]C[4]"
Range("B6").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-3]C[5]"
Range("B7").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-4]C[6]"
Range("B8").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-5]C[7]"
Range("B9").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-6]C[8]"
Range("B10").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-7]C[9]"
Range("B11").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-8]C[10]"
Range("B12").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-9]C[11]"
Range("C2").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[4]C*80"
Range("C3").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[3]C[1]*80"
Range("C4").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[2]C[2]*4"
Range("C5").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[1]C[3]*80"
Range("C6").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!RC[4]*80"
Range("C7").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-1]C[5]*6"
Range("C8").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-2]C[6]*6"
Range("C9").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-3]C[7]*6"
Range("C10").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-4]C[8]*6"
Range("C11").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-5]C[9]*6"
Range("C12").Select
ActiveCell.FormulaR1C1 = "='Aldi Sheet'!R[-6]C[10]*6"
Range("C13").Select
End Sub