Changing a string of cell references in a cel

ChristineJ

Well-known Member
Joined
May 18, 2009
Messages
771
Office Version
  1. 365
Platform
  1. Windows
A1=1 (can vary)
A2 =2 (can vary)
A3 = D3, D2, E9, F8, D4, K15 (text string of cell references that can vary: different references, different number of references, different order)

The "allowable" references are C5, D3, D4, D6, F8, G1 (can vary: can vary: different references, different number of references)

Cell A4 should take the "allowable" references from the string in A3: D3, F8, D4 AND then adapt those so the column letter in each cell address is increased by 1 (the value in A1) and and the row number is increased by 2 (the value in A2).

Cell A4 would finally show E5, G10, E6

Can this be done? Would be even better with VBA so values in A1, A2, and A3 do not have to appear on the worksheet - just the result in A4. Thanks!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
better with VBA so values in A1, A2, and A3 do not have to appear on the worksheet
Given that you say at the start of your post that the contents of those three cells can be variable, where would you expect vba to source the information of the cells are not being used?
 
Upvote 0
I really am not very knowledgeable about VBA,. I assumed a variable name could be assigned to each of the three, and each variable set to a value.

That said, if it is not possible, accomplishing this using VBA, using the cell references in A1, A2, and A3 and a formula will be fine.

Thanks for the response.
 
Upvote 0
That's easily done, although for the person using the sheet it would be easier to change the variables in a cell than in vba.
VBA Code:
Sub ChristineJ()
Dim r As Long, c As Long, rng As Range
c = 1 ' A1
r = 2 ' A2
Set rng = Range("D3,F8,D4") ' A3
Range("A4").Value = rng.Offset(r, c).Address(0, 0)
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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