Change prices

PIsabel

Board Regular
Joined
Feb 4, 2014
Messages
126
Office Version
  1. 365
Platform
  1. 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?


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
 

Attachments

  • _10670.jpg
    _10670.jpg
    32.4 KB · Views: 9

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
It is hard to work with a picture. It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach screenshots (not pictures) of your sheets. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given alink to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 
Upvote 0
I solved it
Good to hear you solved it.

If you would like to post the solution then it is perfectly fine to mark your post as the solution to help future readers. Otherwise, please do not mark a post that doesn't contain a solution.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,114
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top