+ Reply to Thread
Results 1 to 4 of 4

If statement and location of workbook

  1. #1
    Forum Contributor
    Join Date
    01-26-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    162

    If statement and location of workbook

    Hi,

    I am trying to use some if statements to bring data depending on some cells however I am struggling a bit. I think that maybe a vb code is required.

    I have a report sheet where I would like to bring data from external workbooks depending the cells' value.

    Short description:

    Cell B2="Employee Name"
    Cell B3= "Type of Analysis"
    Cell B4= "Year"
    Cell B5= "Month"

    All the above cells will change and the outcome will be displayed below as explained in attached sample. Below where "CellB2Value" that represent value of the above cell in this instance "Employee Name".


    Cell A8= "Value of B3" of which the below cells depending
    Cell A9= If value of A8 = "Support", locate&bring_value from "'C:\TEST\TIMESHEETS\CellB4Value\CellB2Value\[CellB2Value_TIMESHEET_CellB4Value.xls]]CellB5Value'!$B$6. (Support should pick up all values from !$B6:!$B11 and bring the results in the cells A9:A14)

    Cell A9= If value of A8 = "Control", locate&bring_value from "'C:\TEST\TIMESHEETS\CellB4Value\CellB2Value\[CellB2Value_TIMESHEET_CellB4Value.xls]]CellB5Value'!$B12 (Control should pick up values in order from !$B12:$B20 and bring the results in Report Sheet cells A9:A17)

    Cell A9= If value of A8 = "Project", locate&bring_value from "'C:\TEST\TIMESHEETS\CellB4Value\CellB2Value\[CellB2Value_TIMESHEET_CellB4Value.xls]]CellB5Value'!$B12 (Control should pick up all values in order from !$B12:$B20 and bring the results in Report Sheet cells A9:A18)

    Cell A9= If value of A8 = "Misc", locate&bring_value from "'C:\TEST\TIMESHEETS\CellB4Value\CellB2Value\[CellB2Value_TIMESHEET_CellB4Value.xls]]CellB5Value'!$B31 (Control should pick up all values in order from !$B29:$B31 and bring the results in Report Sheet cells A9:A11)

    Cell A9= If value of A8 = "Absence", locate&bring_value from "'C:\TEST\TIMESHEETS\CellB4Value\CellB2Value\[CellB2Value_TIMESHEET_CellB4Value.xls]]CellB5Value'!$B31 (Control should pick up all values in order from !$B32:$B33 and bring the results in Report Sheet cells A9:A10)


    There are 6 different If statements that should be used in Cells A9:A and the data will change once data from Report Workbook Cell B2,B3,B4,B5 changes. I have attached a copy sample of the report and one of the many users time-sheets that it should locate and bring up the data.

    Many Thanks

    greekboy_uk
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-26-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    162

    Re: If statement and location of workbook

    Can anyone help me please???

  3. #3
    Registered User
    Join Date
    02-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: If statement and location of workbook

    I don't think you need VB for this unless you want to automate report creation. If all you want to do is select the users and month from the pull down and print the Reports page you are looking at, you can use VLOOKUP, or even better INDEX(range to return,MATCH(value,range to look in,0),column number of the range you chose).

    To make the variables included in the file names, you can use INDIRECT to turn strings into actual coded file names names. You may have to link the different workbooks together so they can access each other.

    Here is an example of that INDIRECT
    http://excel.tips.net/Pages/T002813_...alidation.html

    They use =INDIRECT("[Book2]Sheet1!D6"), but the Book2 needs to be open.
    Last edited by delforum; 02-08-2011 at 07:42 PM. Reason: capitalization

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: If statement and location of workbook

    If you want to use a macro here is a way to do it:

    Please Login or Register  to view this content.

+ 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