Updating Cell References by Adding Additional Column

Mable

New Member
Joined
Feb 27, 2009
Messages
41
Hi,

I was wondering if anyone could help me? I have inserted an additional column in a spreadsheet with coding on and i need to change the references in vb but im unsure which number to change. I have inserted a new column in column 'B' so all the references need to be changed by one to make the coding work again. I have copied a small amount of the code so if someone could point me in the right direction it would help alot.

' checks if phase runs in preceeding stage for phase 1 and needs integreen including in green time calcs
If Stage = 1 And Cells(40 + Phase, 4 + Stage) = "YES" And Cells(40 + Phase, 4 + Stages) = "YES" Then
Green = Green + (Cells(33, (4 + Stage)).Value) + (Cells(34, (4 + Stage)).Value)
GoTo Skipped
' checks if phase runs in preceeding stage and needs integreen including in green time calcs
ElseIf Cells(40 + Phase, (4 + Stage)) = "YES" And Cells(40 + Phase, (3 + Stage)) = "YES" Then
'adds phase green time and preceeding intergreen time to toal value of green for phase
Green = Green + (Cells(33, (4 + Stage)).Value) + (Cells(34, (4 + Stage)).Value)
GoTo Skipped
ElseIf Cells(40 + Phase, (4 + Stage)) = "YES" Then ' if phase does not run
'adds only phase green time to toal value of green for phase
Green = Green + (Cells(33, (4 + Stage)).Value)
GoTo Skipped
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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