VBA code to return row values in a different format upon a met condition in the first column (A:A="TRUE")

LeBlo

New Member
Joined
Aug 20, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

I built a list of daily prices in multiple currencies/countries with match and index functions across base prices, discounts and tax rates tables. However, I need to adapt it to another format that display prices in rows with a start and end time. I added a column to the daily price table with "TRUE" or "FALSE" (column A) if the price of x item changed from the previous day. I am not familiar with VBA syntax, so I would really appreciate it if someone could provide a code that minimizes the amount of manual work required to switch to the second format. I reckon it must be possible to return the prices by product, country and the start date if A:A ="TRUE" and simultaneously adding the end date of the previous vba entry by taking the start date - 1 day. The end date for prices that do not change anymore in the dataset would be =TODAY() until it changes in the future.

I have attached screenshots with dummy data to help you understand the challenge I'm facing. I can also provide the excel file with dummy data upon request if it can help you. The first sheet is the daily table, and the second sheet is the new format I need to transition to. Thank you very much for your help in advance.

Cheers
 

Attachments

  • Dailypricedummy.png
    Dailypricedummy.png
    95.3 KB · Views: 23
  • newformatdummy.png
    newformatdummy.png
    29.5 KB · Views: 23

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,892
Messages
6,175,236
Members
452,621
Latest member
Laura_PinksBTHFT

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