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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You need to share excel file and highlight the result that you require.
 
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,933
Members
449,195
Latest member
Stevenciu

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