+ Reply to Thread
Results 1 to 7 of 7

From selected cell, choose a range

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    From selected cell, choose a range

    I'm getting hung up on syntax, so am asking for help. I have the following variables:
    Please Login or Register  to view this content.
    FirstCol is my selected column, which can be anywhere on the page, OR FirstCol is Column A (choice is up to the user)
    LastCol is the last populated column on the activesheet
    In my selected column, I'm stepping down through the cells to determine which cells are duplicates, to color those with alternating bands of color. My code below works great for the selected column, but I want to color the range from FirstCol to LastCol within the rows currently selected by the macro, and can't figure out how to phrase that. Your help is greatly appreciated.
    Please Login or Register  to view this content.
    I know I'm not stupid, but I suspect I'm a lot stupider than I think I am

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: From selected cell, choose a range

    Hi would suggest you attach a file showing what you have and what you want to achieve,
    this will tell more than 1000 words, the picture tells the story
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: From selected cell, choose a range

    Thanks keebellah. What I was trying to do was make a macro to color all rows that contain duplicates, in alternating colors, from either Column A to the last column, or from the column the users selects to the last column. But I was stuck, on syntax, with my old code. Since I couldn't figure it out, I trashed it and went a different route. Completed code is below, and a working model is attached.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: From selected cell, choose a range

    Hi, I'll check tomorrow, is past midnight here
    Good-night

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: From selected cell, choose a range

    If I understand you correctly you're happy with his, it does the job (when sorted)

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: From selected cell, choose a range

    Actually, I'm having an issue with it. See post at https://www.excelforum.com/excel-pro...ml#post5129236

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: From selected cell, choose a range

    Answer/tip in the mentioned post

+ 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. Button that inserts a text into a selected cell or a range on selected cells
    By gorely84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2018, 10:47 PM
  2. Replies: 1
    Last Post: 07-03-2017, 11:11 AM
  3. Choose Random Cell From Range Value Unless Equals 0
    By Hellfromabove in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-03-2014, 09:09 PM
  4. How to choose a specific row among selected ones
    By ref in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2012, 01:35 PM
  5. Choose cell in range
    By Jivo in forum Excel General
    Replies: 2
    Last Post: 02-06-2009, 05:53 AM
  6. How to choose selected data in large list?
    By dev in forum Excel General
    Replies: 2
    Last Post: 09-01-2006, 09:39 PM
  7. Choose data from a selected range and put result in new column
    By Betsy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-30-2006, 11:20 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