ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can I apply a discount across a complete workbook? (https://www.excelbanter.com/excel-worksheet-functions/217992-can-i-apply-discount-across-complete-workbook.html)

Pauliexjr

Can I apply a discount across a complete workbook?
 
I have a price list created in Excel and I need to apply a 30% discount
across the entire range. As a lot of the prices are composed of other figures
within the workbook most cells contain macros, so I can't just cut and paste
as the macros corrupt. I have in excess of 400 prices to update so one cell
at a time is going to take forever!

Gary''s Student

Can I apply a discount across a complete workbook?
 
Select the cells that you want to discount and run this macro:

Sub discount()
' gsnuxx
s1 = "=("
s2 = ")*.7"
For Each r In Selection
If IsEmpty(r) Then
Else
v = r.Formula
If Left(v, 1) = "=" Then
v = Right(v, Len(v) - 1)
End If
r.Formula = s1 & v & s2
End If
Next
End Sub

Then continue with the next worksheet in the workbook.
--
Gary''s Student - gsnu200829


"Pauliexjr" wrote:

I have a price list created in Excel and I need to apply a 30% discount
across the entire range. As a lot of the prices are composed of other figures
within the workbook most cells contain macros, so I can't just cut and paste
as the macros corrupt. I have in excess of 400 prices to update so one cell
at a time is going to take forever!


Pecoflyer[_91_]

Can I apply a discount across a complete workbook?
 

Pauliexjr;200046 Wrote:
I have a price list created in Excel and I need to apply a 30% discount
across the entire range. As a lot of the prices are composed of other
figures
within the workbook most cells contain macros, so I can't just cut and
paste
as the macros corrupt. I have in excess of 400 prices to update so one
cell
at a time is going to take forever!


Enter 0.7 in an empty cell - Copy - Select the range to discount -
Right Click - Paste special - Check "Multiply" - OK


--
Pecoflyer

Cheers -
*'Membership is free' (http://www.thecodecage.com)* & allows file
upload -faster and better answers

*Adding your XL version* to your post helps finding solution faster
------------------------------------------------------------------------
Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=55051



All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com