Macro to insert a cell dependent on results from Vlookup

ChocksterNo1

New Member
Joined
Mar 22, 2011
Messages
24
Hi

I was hoping someone could help me.

I have several reports that once run have several worksheets, I have a macro that is applied to each of the reports which produces a menu page and has a hyperlink to each of the worksheets in the report (workbook).

The hyperlinks are all in one column (column B) and each report may vary with the number of hyperlinks from cells B6 to B27.

The problem I have is that there are 3 levels of reports (Group, Office and Cost Centre reports). The Group hyperlink will always be at the top in Cell B6, however the Office and Cost Centre hyperlinks will be mixed.

I need the Group hyperlink to be in Column B, the office hyperlinks in column C, and the Cost Centre reports in Column D in the same row as they were in Column B.

I was thinking if I put a list of all the office hyperlinks in cells B40:B47 and did a If Vlookup whereby if the office hyperlink was found a cell would be inserted and the hyperlink would be moved one column to the right, if the office hyperlink wasn't found, then the hyperlink would be moved 2 columns to the right (as this would be a Cost Centre report).

Is there an easy way to do this?

Thanks

Chock
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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