MixedUpExcel
Board Regular
- Joined
- Apr 7, 2015
- Messages
- 222
- Office Version
- 365
- Platform
- Windows
Hi All,
I don't know if this has been answered as I don't know how to word the question.
I want to put some code together which will do the following:
Put the code in Cell A1
I can do the above, however, I want to fix the namedrange within the code as it will always be the same.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]REP NAME[/TD]
[TD]REGION[/TD]
[/TR]
[TR]
[TD]REP 1[/TD]
[TD]NORTH[/TD]
[/TR]
[TR]
[TD]REP 2[/TD]
[TD]NORTH[/TD]
[/TR]
[TR]
[TD]REP 3[/TD]
[TD]SOUTH[/TD]
[/TR]
[TR]
[TD]REP 4[/TD]
[TD]SOUTH[/TD]
[/TR]
[TR]
[TD]REP 5[/TD]
[TD]EAST[/TD]
[/TR]
[TR]
[TD]REP 6[/TD]
[TD]EAST[/TD]
[/TR]
[TR]
[TD]REP 7[/TD]
[TD]WEST[/TD]
[/TR]
[TR]
[TD]REP 8[/TD]
[TD]WEST[/TD]
[/TR]
[TR]
[TD]REP 9[/TD]
[TD]WEST[/TD]
[/TR]
</tbody>[/TABLE]
The data in Cell B1 will be one of the Reps and I want to run the Macro to automatically insert the Region into Cell A1.
How do I store the namedrange within my code? And then make sure that my vlookup calls that data correctly?
Thanks in advance.
Simon
I don't know if this has been answered as I don't know how to word the question.
I want to put some code together which will do the following:
Put the code in Cell A1
Code:
vlookup(B1,namedrange,2,0)
I can do the above, however, I want to fix the namedrange within the code as it will always be the same.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]REP NAME[/TD]
[TD]REGION[/TD]
[/TR]
[TR]
[TD]REP 1[/TD]
[TD]NORTH[/TD]
[/TR]
[TR]
[TD]REP 2[/TD]
[TD]NORTH[/TD]
[/TR]
[TR]
[TD]REP 3[/TD]
[TD]SOUTH[/TD]
[/TR]
[TR]
[TD]REP 4[/TD]
[TD]SOUTH[/TD]
[/TR]
[TR]
[TD]REP 5[/TD]
[TD]EAST[/TD]
[/TR]
[TR]
[TD]REP 6[/TD]
[TD]EAST[/TD]
[/TR]
[TR]
[TD]REP 7[/TD]
[TD]WEST[/TD]
[/TR]
[TR]
[TD]REP 8[/TD]
[TD]WEST[/TD]
[/TR]
[TR]
[TD]REP 9[/TD]
[TD]WEST[/TD]
[/TR]
</tbody>[/TABLE]
The data in Cell B1 will be one of the Reps and I want to run the Macro to automatically insert the Region into Cell A1.
How do I store the namedrange within my code? And then make sure that my vlookup calls that data correctly?
Thanks in advance.
Simon