Subtracting Dynamic Ranges

George01380

New Member
Joined
Aug 24, 2015
Messages
1
Hi,

I am currently working on a VBA code for share analysis and I have found a very useful spreadsheet that takes stock data from yahoo finance based on your ticker list and start and end dates that you set.
When you click 'get bulk quotes' command it retrieves date, open, high, low, close, volume and adj close data for each company, and places each companies data in a new worksheet. It also renames each worksheet to match the companies ticker.

What I want to do is manipulate the data retrieved to look at price change during the day for example. So what VBA code would I use to subtract the close price from the open price and place it in column H, for all the worksheets? The close and open price are in rows B and E on all worksheets.

The complexity is that the number of sheets can vary as well as the number of rows on each sheet. The amount of rows on each sheet will always be the same compared to each other, but can vary every time you press 'get bulk quotes' if you choose different dates.

Many thanks for any replies!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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