+ Reply to Thread
Results 1 to 6 of 6

Copy Data to another sheet based on the Value

  1. #1
    Registered User
    Join Date
    10-31-2003
    Location
    India
    Posts
    24

    Copy Data to another sheet based on the Value

    Hi,

    I need a big help from this group.i am newbie to VBA.I copied this code from another file & changed accordingly to my needs.But did not get success,

    I got a “Main” sheet in excel & want to get them copied to SID sheet based on the value selected in col E.

    Suppose if I input SID in col E,then entire row wherever SID is reflecting in Col C in Main sheet should get copied to SID sheet.

    I am attaching the zipped file.

    Regards
    Raj
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Theres no problem with the VBA, it's your sheet design. AutoFilter is not recognising the Header Rows, probably because there is no entry in Q1.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-31-2003
    Location
    India
    Posts
    24
    Dear Roy,
    Thanks for the feedback.

    I applied some dummy header in Q1,but still there seems to be problem.

    It shows
    Run-time error ‘1004’:
    Method ‘Range’ of Object’ _Golbal failed.

    When clicked Debug->
    Sheets("Main").Range("A1").AutoFilter Field:=1, Criteria1:=Range("FindItem")

    Any other alternative.Sorry for the trouble.

    Rajkumar

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Quote Originally Posted by Rajkumar
    Dear Roy,
    Thanks for the feedback.

    I applied some dummy header in Q1,but still there seems to be problem.

    It shows
    Run-time error ‘1004’:
    Method ‘Range’ of Object’ _Golbal failed.

    When clicked Debug->
    Sheets("Main").Range("A1").AutoFilter Field:=1, Criteria1:=Range("FindItem")

    Any other alternative.Sorry for the trouble.

    Rajkumar
    The only trouble is this darn website keeps locking up,
    Criteria1:=Range("FindItem")
    FindItem is a named range, field 1 is the first column to be filtered, criteria1 is the first item to filter by,
    If you want to use the name FindItem, you need to select the cell that you want to filter by, then go to insert,name,define, name that range FindItem, see what happens then

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    After looking at the worksheet I believe this will work, once you have located where to place the range
    "FindItem"
    this part needs to be changed to..
    Please Login or Register  to view this content.

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Here's your sample workbook,
    There is a drop down menu in E1 I just use Column E from the main worksheet to get the list, you will have to make a list if you want to do it that way , use the drop down to select what you want filtered,

    Your one post of just entering Sid in E1 does not make sense as there is no such word in the column
    Last edited by davesexcel; 06-28-2008 at 09:53 AM.

+ 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