VBA code to return row values in a different format upon a met condition in the first column.

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 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. I can also provide the excel file upon request. The first sheet is the daily table, and the second sheet is the new format I need to transition to.

Any help would be greatly appreciated!
Cheers
 

Attachments

  • Dailypricedummy.png
    Dailypricedummy.png
    95.3 KB · Views: 15
  • newformatdummy.png
    newformatdummy.png
    29.5 KB · Views: 12

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You need to share excel file and highlight the result that you require.
 
Upvote 0

Forum statistics

Threads
1,216,087
Messages
6,128,740
Members
449,466
Latest member
Peter Juhnke

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