+ Reply to Thread
Results 1 to 11 of 11

If cell value equals...

  1. #1
    Registered User
    Join Date
    09-19-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    7

    If cell value equals...

    Hello,

    I'm not sure if this is possible. I'm a system administrator and have a number of computer servers that get patched and updated. I want to devise a schedule and then have the server names displayed in calendar like formula. The idea was to have Sheet A have all the values. Column A would have Server names and Column B would have a value indicating what week (ie 3W = 3rd Wednesday of the month).

    My hope is that if I have say 3W, it would take the server name from Column A and input it into the cell on Sheet 2 indicating the 3rd Wednesday.

    My guess is that I'd have to use VBA? I'm fairly familiar with VBS, but I've never really used it for excel. I'm not even sure what I'm looking to do is possible. There would be multiple values being written on the Calendar sheet.

    Thanks.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: If cell value equals...

    This can probably be done with a VLOOKUP formula or possibly a pivot table. How will the use "select" the server to be dealt with? Can you attach a sample workbook and mockup how you want it to perform?
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    09-19-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: If cell value equals...

    Sure. In my sample, the 'Calendar' sheet would automatically be updated based on 'Datacenter' sheet, column B.

    Thanks,
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: If cell value equals...

    Well, you were right about needing VBA. See attached. Note: I added a dropdown to keep the scheduled days consistent so the macro shouldn't generate an error. It will if you don't choose a day for each server. I also had to insert named ranges for each possible day in the calendar. See attached.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-19-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: If cell value equals...

    Wow! I was not expecting you to do it. This is brilliant. Thanks!

  6. #6
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: If cell value equals...

    You're welcome. One of the weaknesses of this approach is that the scheduled days next to the server names is a named range, so if you add more dates beyond what's already there, you'll need to expand the name to account for all rows. If needed, I can automate that for you.

  7. #7
    Registered User
    Join Date
    09-19-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: If cell value equals...

    I have a different question, how do you declare a string for the Dates column? I know that you used the Data Validation feature to create the dropdown and noticed that it was pointing to =MaintenainceDays. I also noticed you had 'ScheduledDays' in the VBA. How do you decalre those?

  8. #8
    Registered User
    Join Date
    09-19-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: If cell value equals...

    Quote Originally Posted by nocode View Post
    I have a different question, how do you declare a string for the Dates column? I know that you used the Data Validation feature to create the dropdown and noticed that it was pointing to =MaintenainceDays. I also noticed you had 'ScheduledDays' in the VBA. How do you decalre those?
    Nevermind - I figured it out!

  9. #9
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: If cell value equals...

    If you unhide the D column, you will find the named range MaintenanceDays. I simply selected the values, then used the name manager on the formulas ribbon to insert the name. Scheduled days refers to B2:B5 on the DataCenter sheet and was created the same way. Also, there is a named range for every cell in the body of the calendar.

  10. #10
    Registered User
    Join Date
    09-19-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: If cell value equals...

    Ok - I'm almost there. Not all rows will have a scheduled maintenance so there maybe blank fields in the Date column. If I removed a value from your example, it would break at
    If Application.Range(strRngName).Value <> "" Then
    I even tried putting in an isNull statement, but it errored out at the same spot. I also added a blank cell to the MaintenanceDays list and that still gave me the same problem. If a Null value can't be used, should I add a cell to 'ScheduledDays' and name it 'NM'. Then in the Calendar sheet, all NM values would be be written in a No Maintenance cell? I hope that makes sense.

    Side question - can you remove Name cells? <--Figured it out.
    Last edited by nocode; 09-19-2011 at 05:54 PM.

  11. #11
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: If cell value equals...

    You're right on the money with the NM cell concept. See attached update.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1