PIsabel
Board Regular
- Joined
- Feb 4, 2014
- Messages
- 126
- Office Version
- 365
- Platform
- Windows
Hello.
I have a workbook with two sheets: "DC_Orç" and "DC_compostos".
The "DC_orç" sheet is our budget and the "DC_Composto" sheet is where we enter all the costs that help calculate the sales prices of our items (reference, description and price) and is therefore a kind of database for that budget .
Catalog items are also included in the budget, with references, descriptions and supplier prices.
As prices change almost daily, sometimes we have to change customer prices
What I've achieved so far is this macro that updates all PVPs.
What I need is for this macro to only change the items that were created in the "DC_compostos" worksheet.
someone help me?
I have a workbook with two sheets: "DC_Orç" and "DC_compostos".
The "DC_orç" sheet is our budget and the "DC_Composto" sheet is where we enter all the costs that help calculate the sales prices of our items (reference, description and price) and is therefore a kind of database for that budget .
Catalog items are also included in the budget, with references, descriptions and supplier prices.
As prices change almost daily, sometimes we have to change customer prices
What I've achieved so far is this macro that updates all PVPs.
What I need is for this macro to only change the items that were created in the "DC_compostos" worksheet.
someone help me?
VBA Code:
Sub Dc_muda_pvp()
'muda formulas coluna PVP
Sheets("DC_Orç").Select
Dim g As Range
For Each g In Range("G10:G" & Range("B" & Rows.Count).End(xlUp).Row)
g.Select
If g <> "" Then
g = "=IFERROR(VLOOKUP(RC[-5],DC_Compostos!C[-6]:C[-1],6,0),"""")"
DoEvents
End If
Next g
End Sub