Lookup text

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Assuming that there will always be only one value within AD12:AJ56, try the following formula that needs to be confirmed with CONTROL+SHIFT+ENTER...

=INDEX(AD12:AJ56,SMALL(IF(AD12:AJ56<>"",ROW(AD12:AJ56)-ROW(AD12)+1),1),SMALL(IF(AD12:AJ56<>"",COLUMN(AD12:AJ56)-COLUMN(AD12)+1),1))
 
Upvote 0
Domenic, could I ask, what the situation would be if there were multiple cells with references in the range AD12 to AJ56, it currently returns an error. Would this make it much more complicated to sort ?
 
Upvote 0
If there were more than one cell containing a value, which value would you like the formula to return? An example with some sample data, along with your expected result, would help.
 
Upvote 0
Thank you for getting back to me Domenic

This range where text appears is actually references which the user has not updated properly, so I have a msgbox saying that a particular reference has not been updated, this being the only way I can think of doing it

As you can see, if there are multiple cells with references showing then AD9 returns an error. I guess, I would need to show one at a time, so if the user updates the macro they will see one cell needing correcting, then if, they try again, they will see another and so forth.

Not the most practical but with my basic VB stills it will suffice

Thanks once again

Paul


 
Upvote 0
First, if there's more than one cell containing a value, the formula should not return an error. Secondly, are you now looking for a VBA solution? If so, can you describe step-by-step what needs to take place?
 
Upvote 0
To give you some better detail, this is a step by step approach

B12:B56 Houses the name of every employee in the department
C12:C56 Has the times these individuals work on a Sunday (they may not all be in, if they're not it remains blank)
D12:D56 Has the times the individuals work on a Monday this repeats up to I12:I56 for the remaining week

The manager will select a colour, the colour determines what task they are meant to do that day, he/she will do it for the entire week. This should mean every cell, where an employee is in (ie there is text there C12:I56) should be shaded in

When the manager has finished, they click on a button which sends an email to notify HR.

What I want is when they click on that button, it does a check to make sure that all the cells that have times in for that week have been formatted .

If a cell has a time but has not been formatted then the message should says consultant XX has not been issued a task on ****day (that being the day of the week)

The days of the week are in C11:I11


If a cell has been formatted but there is no time then the message should say consultant XX has been issued with a task on ***day but is not in

The routine should then exit, if everything is ok then it should continue on and email to HR, this code is already in place

It is worth pointing out the following

L12:L56 has a duplication of the names

M12:M56 has the description of task for the Sunday for the employee, this updates automatically based on the colour selected in C12:C56
N12:N56 has the time the employee is in for the Sunday

This replicates across the columns for each day up to Z12:Z56

So as a further example

I select C42 as red, this will then populate M42 with the task and N42 has the time the employee is in for. The employees name appears in B42 and L42


Hope that explains everything????


Thank you
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

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