Macro to add offset volume and price to either side if i run macro.

zone709

Well-known Member
Joined
Mar 1, 2016
Messages
2,079
Office Version
  1. 365
Platform
  1. Windows
Would like to do a macro like a pop up to ask the price and then enter it in M6 and then have it add the price and the offset volume to the ranges below. So like the first example. you can see I have 225 buys and 100 sales on first example. To flatten it out when I have the pop up box I enter 5580. Then it would add it to the right or left side as you can see in yellow which will flatten it out 225 by 225. It would have to add it to the next cell that's empty, because it might have number there in range below. Even help on a start of this would be great thanks


Range
VOL PRICE VOL PRICE
C12 D12 H12 I12
C19 D19 H19 I19


Excel 2016 (Windows) 32 bit
A
B
C
D
E
F
G
H
I
J
K
L
M
1
2
3
4
5
Current Price
6
When only I type a price in-->
5580
7
N
BUYS
N
SALES
8
225​
5533.33​
100​
5560.00​
9
QUANITY​
PRICE​
QUANITY
PRICE
10
INITIAL POSITIONINITIAL POSITION
11
CURRENT PRICE
0​
CURRENT PRICE
0​
12
EXECUTED​
100​
5500​
550000​
EXECUTED​
100
5560
556000​
IF
13
125​
5560​
695000​
0​
14
0​
0​
15
0​
0​
16
0​
0​
17
0​
0​
18
0​
0​
19
0​
0​
20
21
22
225
BUYS
225
SALES
23
0​
0.00​
0​
0.00​
24
QUANITY​
PRICE​
QUANITY
PRICE
25
INITIAL POSITIONINITIAL POSITIONTHEN
26
CURRENT PRICE
0​
CURRENT PRICE
0​
27
EXECUTED​
100​
5500​
550000​
EXECUTED​
100
5560
556000​
28
125​
5560​
695000​
125
5580
697500​
29
0​
0​
30
0​
0​
31
0​
0​
32
0​
0​
33
0​
0​
34
0​
0​
35
OR THE OTHERSIDE
36
N
BUYS
N
SALES
37
100​
5500.00​
0​
0.00​
38
QUANITY​
PRICE​
QUANITY
PRICE
39
INITIAL POSITIONINITIAL POSITION
40
CURRENT PRICE
0​
CURRENT PRICE
0​
41
EXECUTED​
100​
5500​
550000​
EXECUTED​
100
5560
556000​
42
0​
125
5575
696875​
43
0​
0​
44
0​
0​
45
0​
0​
46
0​
0​
47
0​
0​
48
0​
0​
49
50
225
BUYS
225
SALES
51
0​
0.00​
0​
0.00​
52
QUANITY​
PRICE​
QUANITY
PRICE
53
INITIAL POSITIONINITIAL POSITION
54
CURRENT PRICE
0​
CURRENT PRICE
0​
55
EXECUTED​
100​
5500​
550000​
EXECUTED​
100
5560
556000​
56
125​
5580​
697500​
125
5575
696875​
57
0​
0​
58
0​
0​
59
0​
0​
60
0​
0​
61
0​
0​
62
0​
0​

<tbody>
</tbody>
Sheet: Sheet1

<tbody>
</tbody>
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
maybe this is to complicated and have to re think it. Not worried about the ranges more concerns about added the volume to match either side and the price inputted.
 
Upvote 0

Forum statistics

Threads
1,216,089
Messages
6,128,760
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