Closed Thread
Results 1 to 3 of 3

Code for selecting a "floating" range

  1. #1
    Registered User
    Join Date
    02-24-2009
    Location
    Shelley, ID
    MS-Off Ver
    Excel 2007
    Posts
    10

    Code for selecting a "floating" range

    I am pulling in some data from the web...since the data that is pulled in can move around on me, I am using code to find a specific word and then using an offset to select and activate the first cell in a range of 10 cells I want to copy...

    ...now is there a code that would select the current active cell plus the 9 cells below it?? Maybe using R1C1 to have it step down 9 cells selecting all ten cells???

    Of course, this would be really simple if I could count on those ten cells being in the exact same range everyime, but they aren't.

    Here is my code so far:

    Sheets("DataTemp").Select
    Cells.Find(What:="Related Companies", After:=ActiveCell, LookIn:= _
    xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
    xlNext, MatchCase:=False, SearchFormat:=False).Offset(3, 1).Select

    ...Now how do I also tell it to highlight and select the 9 cells under the current active cell so I can copy and move the data in all ten cells?

    A code snip it or any help would be greatly appreciated!

    Thanks

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    21,528

    Re: Code for selecting a "floating" range

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    21,528

    Re: Code for selecting a "floating" range

    This is (now) a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.

Closed 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