+ Reply to Thread
Results 1 to 10 of 10

problem with assigning row number

  1. #1
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    problem with assigning row number

    The below code finds a cell that contains the word "Japan". Then a range is set according to the cell location of the word "Japan". That part is working.

    Next, I want to set the variable FoundRow to the Row in which the word Japan was found.
    How does the code for that look like?

    Please Login or Register  to view this content.
    Last edited by dschmitt; 05-09-2010 at 08:28 PM.

  2. #2
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: problem with assigning row number

    based on what little information provided I'm not sure if the below will work but you can give it a try. If this doesn't work then I would post a sample set of data along with the rest of your macro. I also included an example on how to put the row numbers in the spreadsheet for storage, in case japan appears more then once.

    Please Login or Register  to view this content.
    Last edited by randell.graybill; 05-06-2010 at 10:48 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    Re: problem with assigning row number

    I attached an Excel example.

    The example creates a hyperlink for each name on Sheet "SC-Author ranking" to the corresponding author name on Sheet "Author ranking". That is working.

    Additionally I want to copy the value in the SC-Sum column of Sheet "SC-Author ranking" to the corresponding author name, column SC-Sum on Sheet "Author ranking". That I don't know how to.

    The sheet "Result" illustrates what I want to achieve on sheet "Author ranking".
    Attached Files Attached Files
    Last edited by dschmitt; 05-07-2010 at 12:07 AM.

  4. #4
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: problem with assigning row number

    Place the following formula in Cell M2 on sheet Author Ranking:

    Please Login or Register  to view this content.
    or if you wanted it to be done in vba you could do: Add the below code after next JAuth2Rw. However with the formula it would calculate each time formulas are calculated without the need to run the macro.

    Please Login or Register  to view this content.
    Last edited by randell.graybill; 05-07-2010 at 12:20 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    Re: problem with assigning row number

    thanks for the tip. Unfortunately I can't do it that way. I need to make it part of the Sub.
    I am trying to put the code in the Do - Loop while not loop.

  6. #6
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    Re: problem with assigning row number

    I made an attempt to illustrate more closely what I am trying to do. See attached file.
    Now the numbers are copied from sheet "SC-Author ranking" to sheet "Author ranking". But into the wrong cells.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Re: problem with assigning row number

    does this work?

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    Re: problem with assigning row number

    Yes! That's it. Thanks ShredDude. I attached the solution Excel file.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: problem with assigning row number

    I got it to work by doing the following:

    Please Login or Register  to view this content.
    Last edited by randell.graybill; 05-07-2010 at 02:19 AM.

  10. #10
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    Re: problem with assigning row number

    randell, thanks for you continued interest.

    It turns out that the solution that I posted in Example3.xlsm creates errors when I apply it to a large data set.
    For that reason I switched to a For - next loop. At least there I know what I am doing. See attached file.
    However, considering that I am dealing with large data sets a faster solution would be better.
    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