MeisterConrad
New Member
- Joined
- Jan 17, 2017
- Messages
- 39
- Office Version
- 2007
Can anyone tell me what's wrong with this bit?
On the "AccountInfoSheet, I have a range for the user to input names for different accounts. -So "currently", the list is blank. So I'm trying to make a code that inserts a formula into the merged cell D9:N9 on the "current" sheet (NOT the AccountInfoSheet).
This whole bit is part of a loop that relies on the counter n. So the next time around, we'd be on a different worksheet, and the last line of code would refer to the next item in the list of account names.
The only reason it needs to be a formula is so that the user can enter the account names in the list at a later date, and those names get input into D9:N9 on the NON-"AccountInfoSheet"- sheets. If there's a better way to do THAT, I'm all ears.
Thanks for any advice.
On the "AccountInfoSheet, I have a range for the user to input names for different accounts. -So "currently", the list is blank. So I'm trying to make a code that inserts a formula into the merged cell D9:N9 on the "current" sheet (NOT the AccountInfoSheet).
This whole bit is part of a loop that relies on the counter n. So the next time around, we'd be on a different worksheet, and the last line of code would refer to the next item in the list of account names.
VBA Code:
Dim b As Range
b = Sheets("AccountInfoSheet").Range("E4:E23")
n = n + 1
' So at this point, n=4, which makes n-3=1. This makes (or is supposed to make) the next line refer to the first item in the range E4:E23,
' and insert the cell address for that item into the formula.
' The formula gets input into the merged cell D9:N9.
Range ("D9:N9).Formula = " = CONCATENATE("Click here to data-sort this ", "&Range(b)(n-3).Address&", " Ledger")"
The only reason it needs to be a formula is so that the user can enter the account names in the list at a later date, and those names get input into D9:N9 on the NON-"AccountInfoSheet"- sheets. If there's a better way to do THAT, I'm all ears.
Thanks for any advice.