SubtleNoob
New Member
- Joined
- Nov 22, 2015
- Messages
- 11
I've tried looking round and there have been a few posts similar but the questions I could find didn't have the answer I needed within them.
Its pretty simple and I have a fairly reasonable understanding of macros and can do some basic stuff so VBA is as welcome as a formula in any solutions.
I have the abbreviated layout below:
[TABLE="width: 498"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]qq2[/TD]
[TD]=IFERROR(VLOOKUP("ff",'A2'!A1:Z99,2,FALSE),0)[/TD]
[/TR]
[TR]
[TD]ss3[/TD]
[TD]=IFERROR(VLOOKUP("ff",'ss3'!A1:Z99,2,FALSE),0)[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 626"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Column 1 is the sheet names Column 2 is the formula I have. "ff" is the thing I am looking for. The underlined is where I have a problem. I cannot get excel to use the cell contents in the formula which means I get an error because it ends up looking for sheet "A2" rather than "qq2" or "ss3". Green works Red doesnt.
I tried using CELL but it gave me an error.
=IFFERROR(VLOOKUP("ff",'CELL("contents",A8)'!A1:Z99,2,FALSE),0)
I have tried making a macro using copy and paste inside the formula. It just overwrites the next cell when I run it, as well as moving the the search down one:
Sub Macro4()
'
' Macro4 Macro
'
'
ActiveCell.Offset(0, -1).Range("A1").Select
ActiveCell.FormulaR1C1 = "qq2"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(""ff"",'qq2'!R[-3]C[-1]:R[95]C[24],2,FALSE),0)"
ActiveCell.Select
End Sub
I have a good few hundred sheets to reference on this workbook so entering manually would be very long and because of frequent changes in names and so on it would be hard for my successor to maintain. Thank you very much for your time reading and help if you can offer it.
Any additional questions please ask.
Its pretty simple and I have a fairly reasonable understanding of macros and can do some basic stuff so VBA is as welcome as a formula in any solutions.
I have the abbreviated layout below:
[TABLE="width: 498"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]qq2[/TD]
[TD]=IFERROR(VLOOKUP("ff",'A2'!A1:Z99,2,FALSE),0)[/TD]
[/TR]
[TR]
[TD]ss3[/TD]
[TD]=IFERROR(VLOOKUP("ff",'ss3'!A1:Z99,2,FALSE),0)[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 626"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Column 1 is the sheet names Column 2 is the formula I have. "ff" is the thing I am looking for. The underlined is where I have a problem. I cannot get excel to use the cell contents in the formula which means I get an error because it ends up looking for sheet "A2" rather than "qq2" or "ss3". Green works Red doesnt.
I tried using CELL but it gave me an error.
=IFFERROR(VLOOKUP("ff",'CELL("contents",A8)'!A1:Z99,2,FALSE),0)
I have tried making a macro using copy and paste inside the formula. It just overwrites the next cell when I run it, as well as moving the the search down one:
Sub Macro4()
'
' Macro4 Macro
'
'
ActiveCell.Offset(0, -1).Range("A1").Select
ActiveCell.FormulaR1C1 = "qq2"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(VLOOKUP(""ff"",'qq2'!R[-3]C[-1]:R[95]C[24],2,FALSE),0)"
ActiveCell.Select
End Sub
I have a good few hundred sheets to reference on this workbook so entering manually would be very long and because of frequent changes in names and so on it would be hard for my successor to maintain. Thank you very much for your time reading and help if you can offer it.
Any additional questions please ask.