+ Reply to Thread
Results 1 to 7 of 7

Copy top cell of filter results

Hybrid View

lky2k23 Copy top cell of filter... 12-13-2011, 07:37 AM
JBeaucaire Re: Copy top cell of filter... 12-13-2011, 07:44 AM
lky2k23 Re: Copy top cell of filter... 12-13-2011, 07:51 AM
JBeaucaire Re: Copy top cell of filter... 12-13-2011, 08:02 AM
lky2k23 Re: Copy top cell of filter... 12-13-2011, 08:45 AM
lky2k23 Re: Copy top cell of filter... 12-13-2011, 08:50 AM
romperstomper Re: Copy top cell of filter... 12-13-2011, 06:11 PM
  1. #1
    Registered User
    Join Date
    10-15-2008
    Location
    Coventry
    MS-Off Ver
    2003
    Posts
    70

    Copy top cell of filter results

    I am trying to copy the top cell of a filtered results table to help with a check on another tab.

    I tried recording a macro where i went to the top of the column then down 1 cell but it remembered the cell number(556) rather then down 1.

    Thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy top cell of filter results

    One way:
    Sub CopyFirst()
    Dim LR As Long, MyRNG As Range
    
        On Error Resume Next
        LR = Range("B" & Rows.Count).End(xlUp).Row
        Set MyRNG = Range("B2:B82").SpecialCells(xlCellTypeVisible)
        MyRNG(1).Copy Sheets("Dest").Range("A1")
    
    End Sub
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-15-2008
    Location
    Coventry
    MS-Off Ver
    2003
    Posts
    70

    Re: Copy top cell of filter results

    Sorry can you give me a bit more help on that please? I am using Excel 2003. It colomn *J* i am looking to get the top value from.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy top cell of filter results

    What help would you like? I'm sure you can edit the column "B" references to column "J". What else would you like?

    This is the target example in the code:
    Sheets("Dest").Range("A1")
    Edit that to your preferred destination.

  5. #5
    Registered User
    Join Date
    10-15-2008
    Location
    Coventry
    MS-Off Ver
    2003
    Posts
    70

    Re: Copy top cell of filter results

    Thank you!

  6. #6
    Registered User
    Join Date
    10-15-2008
    Location
    Coventry
    MS-Off Ver
    2003
    Posts
    70

    Re: Copy top cell of filter results

    Is there anyway to paste that result into the 'page' section of a pivot table?

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Copy top cell of filter results

    You should be able to just assign the cell's value to the Currentpage property of the relevant page field in the pivot table.
    Everyone who confuses correlation and causation ends up dead.

+ 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