+ Reply to Thread
Results 1 to 11 of 11

Macro to search row and column for intersect and then input a data to where they meet

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Macro to search row and column for intersect and then input a data to where they meet

    Hi Everyone,

    Here is a problem way beyond my comprehension. Help is needed!!

    In my "cover" sheet I click the allocate cover button and it then generates a list of data below the first table. This generated data now needs to update the "timetable" sheet by using the "allocated cover teacher" and "period" cells as a reference to then input the class code into the timetable at this time.

    cover.jpg

    So in this picture we see that Dorothy*Schultz (in cell E27) has been given a class 3 MABA RM 15(cell D27) on TuesdayP1 (C27). I want search for Dorothy*Schultz and TuesdayP1 in the "timetable" tab to input the name of the class which in this instance would be input to cell I20 in the "timetable tab".

    I imagine I will need to explain this further but if anyone feels they can make any sense of my request please get in touch.
    VBA COVER Forum Version 1.xls
    Thanks
    Alasdair
    Last edited by aloconnor; 07-08-2014 at 06:25 AM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Hi Alasdair,

    I'll take a more in depth look at this tomorrow - have you defined exactly what it is that you want from us??
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    10-15-2012
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Hi,

    Thanks for your help. Frankly, I am not sure that I have explained my problem very well at all. When I click the Allocate Cover button in the "cover" tab, I want the macro to do what it does now (copy and insert the table in new rows beneath) but also search the "timetable" tab for where to input the class. This would be done by using the data in column C and E, finding where they cross reference and insert the data from the same row in column D into that cell in "timetable".

    I hope this makes life slightly clearer.

    Thanks
    Alasdair

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Hi Alasdair,

    I'm having trouble with my forum configuration - but try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-15-2012
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Thanks for your help.

    Unfortunately, I can't seem to get this code to work. It returns a runtime error 13 type missmatch. When I first tried it in the work book it was ok in that it copied and pasted the rows beneath. However when it did so, it did not paste the class into the appropriate cell in the timetable sheet.

    Is there a chance you could have another look at it for me?

    Thanks
    Alasdair

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Hi Alasdair,

    You have to run it on the sheet before you wipe out the entries in the field. The first run will work, the second can't because of the wipeouts

    We could remove the wipeout code but the macro name is ClearForm after all!

  7. #7
    Registered User
    Join Date
    10-15-2012
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Aaahh,

    Right, yes I see. However, I still can get the class to input from the "Cover" sheet to the "timetable" sheet.
    Any thoughts?

    Thanks
    Alasdair

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Well, if there is no data in the cover sheet;;what do you do??

  9. #9
    Registered User
    Join Date
    10-15-2012
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro to search row and column for intersect and then input a data to where they meet

    If there is no data and the class column is reading #N/A, then I would want the macro to ignore it and not paste anything in the timetable sheet.

    Is this possible?

    Thanks
    Alasdair

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Hi Alasdair,

    Try this:


    Please Login or Register  to view this content.
    Last edited by xladept; 07-10-2014 at 02:02 PM.

  11. #11
    Registered User
    Join Date
    10-15-2012
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro to search row and column for intersect and then input a data to where they meet

    Sorry, it still wont seem to input the class into the timetable.

    I have modified the sheet slightly. I have added an extra button called "Input to Timetable". For this button all I need a macro to do is insert the cells from the Cover tab in D21 and below into the Timetable sheet in the cell specified in H21 (cover tab)and below.

    Is there a way to do this?

    Thanks
    AlasdairVBA COVER Forum Modified Version.xls

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Data Input Macro
    By 7hrowdown in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2013, 12:14 PM
  2. Input data in one sheet and store data in another workbook (Macro)
    By Sabzero786 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2012, 06:10 AM
  3. Macro to input data from the data input box.
    By jhc8255 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-13-2010, 08:11 PM
  4. Input data macro
    By jamer02 in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 04-19-2009, 03:03 PM
  5. [SOLVED] Data input macro
    By Jay Oken in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2005, 08:05 PM

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