G
Guest
Hi to all. My code work nice but is a little long. I know that it could be
simplefy using value and other codes that I don't know. can anybody help
me?? I have to run this from column C to N. Here is the code.
Sub Run_Macro()
monthfree = Range("C7").Value
If monthfree = Empty Then
Call Execute
SightPurch = Range("A36").Value
Range("C7").Select
ActiveCell.FormulaR1C1 = SightPurch
InvoiceElite = Range("A37").Value
Range("C8").Select
ActiveCell.FormulaR1C1 = InvoiceElite
Unidentified = Range("A41").Value
Range("C12").Select
ActiveCell.FormulaR1C1 = Unidentified
Else
monthfree = Range("D7").Value
If monthfree = Empty Then
Call Execute
SightPurch = Range("A36").Value
Range("D7").Select
ActiveCell.FormulaR1C1 = SightPurch
InvoiceElite = Range("A37").Value
Range("D8").Select
ActiveCell.FormulaR1C1 = InvoiceElite
Unidentified = Range("A41").Value
Range("D12").Select
ActiveCell.FormulaR1C1 = Unidentified
Else
monthfree = Range("E7").Value
If monthfree = Empty Then
Call Execute
SightPurch = Range("A36").Value
Range("E7").Select
ActiveCell.FormulaR1C1 = SightPurch
InvoiceElite = Range("A37").Value
Range("E8").Select
ActiveCell.FormulaR1C1 = InvoiceElite
Unidentified = Range("A41").Value
Range("E12").Select
ActiveCell.FormulaR1C1 = Unidentified
Else
'AGAIN AND AGAIN UNTIL COLUMN "N"
End If
End If
End If
End Sub
simplefy using value and other codes that I don't know. can anybody help
me?? I have to run this from column C to N. Here is the code.
Sub Run_Macro()
monthfree = Range("C7").Value
If monthfree = Empty Then
Call Execute
SightPurch = Range("A36").Value
Range("C7").Select
ActiveCell.FormulaR1C1 = SightPurch
InvoiceElite = Range("A37").Value
Range("C8").Select
ActiveCell.FormulaR1C1 = InvoiceElite
Unidentified = Range("A41").Value
Range("C12").Select
ActiveCell.FormulaR1C1 = Unidentified
Else
monthfree = Range("D7").Value
If monthfree = Empty Then
Call Execute
SightPurch = Range("A36").Value
Range("D7").Select
ActiveCell.FormulaR1C1 = SightPurch
InvoiceElite = Range("A37").Value
Range("D8").Select
ActiveCell.FormulaR1C1 = InvoiceElite
Unidentified = Range("A41").Value
Range("D12").Select
ActiveCell.FormulaR1C1 = Unidentified
Else
monthfree = Range("E7").Value
If monthfree = Empty Then
Call Execute
SightPurch = Range("A36").Value
Range("E7").Select
ActiveCell.FormulaR1C1 = SightPurch
InvoiceElite = Range("A37").Value
Range("E8").Select
ActiveCell.FormulaR1C1 = InvoiceElite
Unidentified = Range("A41").Value
Range("E12").Select
ActiveCell.FormulaR1C1 = Unidentified
Else
'AGAIN AND AGAIN UNTIL COLUMN "N"
End If
End If
End If
End Sub