+ Reply to Thread
Results 1 to 14 of 14

Highligt row of active cell, error in macro

  1. #1
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Highligt row of active cell, error in macro

    I can't get this to work??
    I want ActiveWindow.ScrollRow to scroll down to the row = the RowNum

    Can someone crack this for me please.

    ' Go to data sheet and select Todays date and Highlight Row

    Please Login or Register  to view this content.
    Last edited by nordicdust; 07-29-2018 at 04:20 PM. Reason: I forgot code wrap

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Highligt row of active cell, error in macro

    Without any Excel sample or at least more details about the issue it is not easy to help ...!
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Highligt row of active cell, error in macro

    Here is the file, thank you for taking a look
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Highligt row of active cell, error in macro

    We seem to be missing a function as called in
    Please Login or Register  to view this content.
    However, the sheet in the sample workbook is called DATABASE, not DATA, so that would error out.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Highligt row of active cell, error in macro

    It seems that "Todays Date Row number" is not accurate because is missing a 8 rows offset due to the header row in sheet "DATABASE"

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    As a beginner starter :

    PHP Code: 
    Sub Demo1()
        
    With Ark5
            
    .Activate
            
    .UsedRange.Rows(Ark80.[D9].Value2).Select
        End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Highligt row of active cell, error in macro

    You would have better to search for the active date in sheet DATABASE and work with the row found

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Highligt row of active cell, error in macro

    Please Login or Register  to view this content.
    Ben Van Johnson

  9. #9
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Highligt row of active cell, error in macro

    See perhaps your code updated


    Please Login or Register  to view this content.
    Last edited by PCI; 07-29-2018 at 05:37 PM. Reason: Protection code made active: Comments removed

  10. #10
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this ‼


    Another way from the date as a beginner starter :

    PHP Code: 
    Sub Demo2()
            
    Dim V
        With Ark5
    .ListObjects(1)
                
    Application.Match(Fix(Ark80.[D4].Value2), .DataBodyRange.Columns(2), 0)
            If 
    IsNumeric(VThen
                
    .Parent.Activate
                
    .ListRows(V).Range.Select
            End 
    If
        
    End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  11. #11
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Try this ‼

    Thanks Marc

    Both your solutions worked great.
    I am not quite sure I understand your code, would you comment it for me. I am new in VBA :-)
    I like Demo1 as it is simpel and stil as fast as Demo2, 0,78 sec. my test showed.
    But I like how Demo2 gets the right cell from the date and not from ENGINE SHEET D9

    This is how I did it before and it is nearly same time to run as yours. Demo3
    Thanks again for your help

    Please Login or Register  to view this content.



    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Highligt row of active cell, error in macro

    Thanks for your effort to help, I did not get your solution to work.
    But thanks for your help :-)

  13. #13
    Forum Contributor
    Join Date
    03-08-2018
    Location
    Denmark
    MS-Off Ver
    2016 for Windows
    Posts
    413

    Re: Highligt row of active cell, error in macro

    Thanks for your help Ben, Marc L found a solution I was happy with :-)

  14. #14
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Highligt row of active cell, error in macro


    Thanks for the rep' !

    I won't comment as it is at beginner level, all is yet within VBA inner help
    except for Application.Match which is the Excel worksheet function MATCH (to see in Excel help) …

+ 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] Simple macro/VBA to copy cell above active cell and then move active cell one right...
    By planetjed in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2018, 02:02 PM
  2. Replies: 1
    Last Post: 04-06-2016, 11:21 AM
  3. Replies: 9
    Last Post: 02-08-2016, 12:55 PM
  4. Highlight Active Row macro, and Bold the Active Cell
    By StudentTeacher in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-08-2013, 07:43 PM
  5. Highlight Active Row macro error
    By rasmus1166 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-04-2011, 08:46 AM
  6. Active sheet.paste error - macro
    By plato in forum Excel General
    Replies: 5
    Last Post: 02-06-2010, 09:26 AM

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