+ Reply to Thread
Results 1 to 7 of 7

Problem with VBA-Excel-Hyperlink and search for strings

  1. #1
    Registered User
    Join Date
    04-22-2012
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Problem with VBA-Excel-Hyperlink and search for strings

    Hello boys and girls!

    I am new in VBA and Excel-macros, with only some small programming experience in my past.

    So, my project might look very easy for you-and I will be very happy if you have any suggestions.

    My project is:

    I have to create an excel worksheet "A", that will have the following properties and do these tasks:


    0) Cells of A will have values that will be automatically updated, when A is opened, depending on cells of another Workbook "B"

    1) From A, access another excel Workbook "B"

    2) Go inside a Hyperlink of the Workbook "B", which is another excel Worksheet "C"

    3) Inside C, scan a whole column range (let's say A1-A1000) that have certain string values (compare it with some certain strings - let's say Basketball, Football, Volleyball)

    4) Count how many results were found, returned True

    5) For each one that returned true, check at that row, for a string at another column (let's say colour of ball, green, red, yellow)

    6) Count those results and return the percentages (on cells of A) of how many balls were green, red or yellow

    7) Also check the date of the moment that A is opened, calculate the difference of days to another cell of C, and return the results on A

    Thank you very much for any suggestions,
    Cheers
    Last edited by michpapas; 04-24-2012 at 03:44 PM. Reason: Typo

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Help in VBA-Excel needed

    To Attach a File:

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Attach a file

  3. #3
    Registered User
    Join Date
    04-22-2012
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Problem with VBA-Excel-Hyperlink and search for strings

    Hello guys again.

    Sorry for the title, I am new here:-) and was a bit desperate :-).

    So I would like your ideas on the following:

    As I didn't know how to write a code for clicking hyperlink, I recorded a macro and then saw the code.
    Please Login or Register  to view this content.
    The problem I face now is how to just access that. I don't want to open the other file. I just want to have access on this Hyperlink in order to check for some data there.

    Regarding my check there I have done the following:

    ---------------------------------------------------------------
    Please Login or Register  to view this content.
    --------------------------------------------------------------

    So, as I have said in my first post, I would like to open one excel file A, that will take data from a hyperlink of another excel, make some search about how many balls are Green and so on, and return the data on the excel file A.

    I would appreciate any suggestions.

    Unfortunately I cannot post the file that has the hyperlink, cause it is for a project I have for a professor.

    Thanks a lot
    Last edited by davesexcel; 04-24-2012 at 08:41 PM. Reason: Code tags required when showing VBA code, please read the forum rules

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Problem with VBA-Excel-Hyperlink and search for strings

    Hi,
    You don't have to supply the original workbook, but just an example workbook.

    Your explanation is difficult to understand.

  5. #5
    Registered User
    Join Date
    04-22-2012
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Problem with VBA-Excel-Hyperlink and search for strings

    Ok guys!

    I've had some progress.

    I've managed to access the data of workbook B, by opening and closing the file :-)

    Please Login or Register  to view this content.
    """"Actually the problem is now how to compare the cells I want, (a range of cells) with specific strings, and count the matches with the specific strings to calculate the percentages.

    """"I would appreciate any help.
    """"By the way, this loop returns me 1500, 1500, 1, so it is always executed :-)
    """"Obviously, I am not an experienced programmer :-)
    ''''''I have problem with this stupid StrComp
    """By the way, the cells I am checking have text, so comparing with strings is the right solution right???
    """"Cheers guys!
    Last edited by davesexcel; 04-26-2012 at 08:13 AM.

  6. #6
    Registered User
    Join Date
    04-22-2012
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Problem with VBA-Excel-Hyperlink and search for strings

    Quote Originally Posted by davesexcel View Post
    Hi,
    You don't have to supply the original workbook, but just an example workbook.

    Your explanation is difficult to understand.
    Unfortunately I don't have the original file at home. I am just running the tests in front of this professor :-(.
    Cheers

  7. #7
    Registered User
    Join Date
    04-22-2012
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Problem with VBA-Excel-Hyperlink and search for strings

    Ok guys!!!

    I solved the problem!!! :-)

    I manage to extract the required info!

    Now I have to calculate the difference between todays' date and some cells which have dates.

    Anyone knows how to do that?

+ 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