+ Reply to Thread
Results 1 to 9 of 9

Index of rows in different spreadsheets

  1. #1
    Registered User
    Join Date
    04-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2002
    Posts
    6

    Post Index of rows in different spreadsheets

    Hi all,

    I've been trying to get something to work for the past few days, and something is wrong in my logic but I just can't figure it out (and it's driving me nuts - as always when things like that don't work !). Here's what I'm trying to do :

    I have my first worksheet, called "Index", which will compile a list of legislative texts to be applied (uninteresting part), based on the other sheets (different sheets for different types of texts). I have a unique reference number for each text. Now, depending on some factors in-house, some texts will sometimes be used, sometimes not. So I have a column of Yes/No which is used to populate my index. Compiling a list in my index (and copying the rows) based on the "Yes" factor is easy. I can check whether the row has already been created quite simply, comparing the unique reference number. Where it gets complicated is that I want to be able to remove rows in my index when a legislative text goes from Yes to No. My code doesn't work...

    Please Login or Register  to view this content.
    I did some tests and the error seems to be a logic one, i.e. coming from those highlighted parts, and not my Module1 subs that delete/create fine. Some rows are created, some are deleted, but it's just not consistent, really not ideal.

    Thanks for the help :D
    Attached Files Attached Files

  2. #2
    Forum Contributor darknation144's Avatar
    Join Date
    01-24-2012
    Location
    London
    MS-Off Ver
    Microsoft Excel 365 MSO
    Posts
    555

    Re: Index of rows in different spreadsheets

    To reference another spreadsheet you usually have to use the absolute path e.g "C:\documents\spreadsheet"
    If someone helped give them rep using the star button.

    If you have received a satisfactory solution please mark the thread solved. If not Fotis will come for you at night :P

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Index of rows in different spreadsheets

    Hi LeMofus. Maybe so? Try to click the green button in the file.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2002
    Posts
    6

    Re: Index of rows in different spreadsheets

    Oh WOW. I have much to learn... Thank you so much.

    I'll take a look at the code and try to understand how you approached the problem, but this seems to work a treat


    Quote Originally Posted by nilem View Post
    Hi LeMofus. Maybe so? Try to click the green button in the file.

  5. #5
    Registered User
    Join Date
    04-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2002
    Posts
    6

    Re: Index of rows in different spreadsheets

    One issue though - my N column has hyperlinks in each spreadsheets; currently my "Index" sheet doesn't copy those hyperlinks, but merely the text that "shows"...

    Simple fix ?

    Still struggling to figure out how this code works !

  6. #6
    Registered User
    Join Date
    04-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2002
    Posts
    6

    Re: Index of rows in different spreadsheets

    Quote Originally Posted by nilem View Post
    Hi LeMofus. Maybe so? Try to click the green button in the file.
    No simple way? I can't seem to figure it out...

    Do I have to write a separate function just for the hyperlinks?

  7. #7
    Registered User
    Join Date
    04-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2002
    Posts
    6

    Re: Index of rows in different spreadsheets

    Looking at your code, the following line
    Please Login or Register  to view this content.
    is the one that copies all of the data into the array. But, it copies values... i.e. not my formula. However, if I change "value" to "text", or "Formula", then I get errors down the line, when the macro updates my index sheet, line :
    Please Login or Register  to view this content.
    What can I use to copy that formula, ideally I'd like to keep the hyperlink formula as is and copy it into the index?

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Index of rows in different spreadsheets

    If the appearance of your links, for example, http://www.excelforum.com/excel-prog...eadsheets.html, then try this:
    Please Login or Register  to view this content.
    .Value = y() - here values are written only (no formulas, formats, etc.)

  9. #9
    Registered User
    Join Date
    04-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2002
    Posts
    6

    Re: Index of rows in different spreadsheets

    Thanks for the help

+ 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