Need some help with Formula

Copper Contributor

Hi, Please check below screen shot of one of Edited POS Excel file, I'm not able to create the Formula for Adding Discount Amount in Receipt area,

Kindly reply me with a VBA Code for the discount Which is Highlighted. the Excel file also attached Please help me to solve this issue.Help Needed.jpg

5 Replies

@Sadusan 

 

With Formula:

=(M11/100%)*F7

 

With VBA:

 

Sub procent()
  Dim lngLast As Long
  lngLast = Cells(Rows.Count, 3).End(xlUp).Row
  With Range(Cells(2, 4), Cells(lngLast - 1, 4))
    .FormulaR1C1 = _
    "=RC[-1]/R" & lngLast & "C[-1]"
    .NumberFormat = "0.00%"
  End With
End Sub

 

Must be adapted to the cells and columns.

 

I would be happy to know if I could help.

 

 

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

 

@NikolinoDE ,

Shouldn't that be:

=M11*$F$7

 

@Craig Hatmaker 

 

I tried below Formula 

=M11*$F$7

 

But the Issue is its only one time it works, by the next time it got removed automatically, That's I request the formula for VBA with the Cell.Annotation 2020-09-16 201230.jpg

@NikolinoDE 

Hi, I appreciate your immediate reply but the VBA Formula which you have given to me, I try but Its not working. 

 

Thank you for your reply.

Sadusan

@Sadusan ,

.Range("N" & AvailRow).Formula = "=M" & AvailRow & "*$F$7"