Syntax for setting an array item to the value of a cell

pbgexcel

New Member
Joined
Jan 2, 2018
Messages
26
Good afternoon all,

I'm having some trouble setting an array item to the value of cell. How can this be done?

Currently I'm working with this:
Code:
Dim ArrayName() As Variant
ArrayName(row no., column no.) = Range(column letter & row number).Offset(0, -1).Value ' I want the value of the cell directly behind the cell in question


Any and all help greatly appreciated! Please let me know if I can clarify in any way.

Thanks so much!


EDIT: I should mention that row nos. and column letters are correct in my code, I've just represented them in the code above.

 
Last edited by a moderator:
Still can't see all the variables being initialized. For example, is Hourly a worksheet or a range or ...? What is GlobalStartingPoint?

I'd recommend stepping through the code using the F8 key to see what values the various variables take on. For example is SlidingStartingPointAsRange a valid range or is it Nothing?
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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