Excel copy one cell from auto filtered results from Mr Excel


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

copy one cell from auto filtered results
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

Lisa_King_3
Board Regular


Joined: 26 Jan 2004
Posts: 39

Flag: Uk

Status: Offline

 Reply with quote  

copy one cell from auto filtered results

icon_biggrin.gif Hi people. I hope someone can help me.

I have a vb code to autofilter a table in a worksheet (Membrship Prices)depending on the values of 2 cells in another worksheet (Weekly). That works fine, but what I can't seem to do is copy the last cell in the filtered results in "Membership Prices" to a cell in "Weekly" I have tried a range of codes, but none work, and i don't know why.

Can anyone shine a light on what I am doing wrong?

These are two codes i have attempted to use (Red code is the bits that aren't working)

Sub Macro1()

Sheets("Membership Prices").Select
Range("B13").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=Sheets("Weekly").Range("B9").Text
Selection.AutoFilter Field:=2, Criteria1:=Sheets("Weekly").Range("C9").Text
Range("D13").Offset(1, 0).Select
Selection.Copy
Sheets("Weekly").Range("E9").PasteSpecial
Application.CutCopyMode = False
Sheets("Membership Prices").Range("B13").Select
Selection.AutoFilter

End Sub

Sub Macro2()

Sheets("Membership Prices").Select
Range("B13").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=Sheets("Weekly").Range("B9").Text
Selection.AutoFilter Field:=2, Criteria1:=Sheets("Weekly").Range("C9").Text
Range("B13").Select
Selection.SpecialCells(xlCellTypeLastCell).Select
Selection.Copy
Sheets("Weekly").Range("E9").PasteSpecial
Application.CutCopyMode = False
Sheets("Membership Prices").Range("B13").Select
Selection.AutoFilter

End Sub

Hope you understand me
Lisa x

Post Tue Jan 27, 2004 3:06 pm 
 View user's profile Send private message

Ponsy Nob.
Board Master


Joined: 26 Sep 2003
Posts: 521

Flag: Israel

Status: Offline

 Reply with quote  

Re: copy one cell from auto filtered results

Sheets("Membership Prices").[B65536].End(xlUp).Copy Sheets("Weekly").[E9]

Post Tue Jan 27, 2004 11:27 pm 
 View user's profile Send private message

Lisa_King_3
Board Regular


Joined: 26 Jan 2004
Posts: 39

Flag: Uk

Status: Offline

 Reply with quote  

Re: copy one cell from auto filtered results

it doesn't work. It does exactly the same as the other formula's i have tried. in the cell E9, where it is copied to, the cell's reference becomes =D2. I think it is because the cell that is copied from the autofilter refers to another cell in that spreadsheet. When the cell that i copy is 1.00 and =B7 in that same sheet, when it is copied to sheet "weekly", the reference in E9 becomes = D2, which is 1 to the left and 7 up? (B7 amking it go up 7, and 1 making it go left one?)

Is there anyway you can alter that code you gave me so that it only copies the text in the cell, not the formula as well?

Thanks

Lisa x

Post Wed Jan 28, 2004 5:25 pm 
 View user's profile Send private message

Ponsy Nob.
Board Master


Joined: 26 Sep 2003
Posts: 521

Flag: Israel

Status: Offline

 Reply with quote  

Re: copy one cell from auto filtered results

Sheets("Weekly").[E9] = Sheets("Membership Prices").[B65536].End(xlUp).Value

Post Wed Jan 28, 2004 11:40 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.