+ Reply to Thread
Results 1 to 12 of 12

Select lines of data that contain words from column F drop down

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    20

    Question Select lines of data that contain words from column F drop down

    I am trying to paste a macro into VBA that will select lines of data that contain the column F drop down "BRING FORWARD / À REVOIR" selection in sheet 2 to sheet 10 using the code below.
    The idea is that I have a list of just the bring forward lines on sheet 10.


    Please Login or Register  to view this content.
    When I paste the code into the VBA I think need to hit submit or something so that Excel takes it. When I go back to Excel and go to Macros, there are none to choose from. Ant ideas?

    Thanks in advance,

    ER

    Moderators Note: Please follow Forum Rule #1 and use concise thread titles from now on. Changed for you this time, but please choose a clearer title in the future…Thanks.
    Last edited by jeffreybrown; 12-22-2012 at 12:23 PM. Reason: Changed from quote tags to code tags.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,028

    Re: Select lines of data that contain words from column F drop down

    I'm not sure where you are pasting your code. It should go into a regular module. Hold down the ALT key and press the F11 key to bring up the Visual Basic editor. Click 'Insert' on the menu at the top and then click 'Module'. Paste your code into the window that appears and run the macro from there. The macro will be there whenever you need it.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Select lines of data that contain words from column F drop down

    Do Alt+F8 while you are at excel.This will take you to the Visual basic page. Once you found the module where the code has been pasted(If you have only this, then there you see module), you hit F5. Once the code is run and assuming the code also works, you go back to excel and see the result.

  4. #4
    Registered User
    Join Date
    09-04-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Select lines of data that contain words from column F drop down

    VBA code.pngI have pasted the code into a regular module (entittled 'Module1') The code is pasted in the wondow, then I go back to Excel and go to Macros and there is nothing in the list. Please see the image.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Select lines of data that contain words from column F drop down

    @Erusso,

    Can you post a sample workbook?

    Attach a sample workbook.

    When you are in Advanced reply, click on the paperclip to open the upload window.

    View Pic
    HTH
    Regards, Jeff

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Select lines of data that contain words from column F drop down

    Try this. On Sheet2 select from the drop down in column F.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-04-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Select lines of data that contain words from column F drop down

    Debug.png

    I got this message

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Select lines of data that contain words from column F drop down

    Erusso,
    The attached is a picture-not much help. It tell us the error number and type.It is like trying the error, but it does not tell us in which line the error occurs.
    Jef has now provided you with attachment. It may be easier for you to copy your code in to Jef's book and test it.

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Select lines of data that contain words from column F drop down

    As AB33 points out, a picture does not help all that much, but what would help is to hit debug and tell us which line is highlighted.

    Could it be you did not change the sheet names? Do you get the error with the attached workbook?

  10. #10
    Registered User
    Join Date
    09-04-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Select lines of data that contain words from column F drop down

    This is the error message I am getting.....Anyone familliar with it?

    Please Login or Register  to view this content.
    Thanks,

    ER

  11. #11
    Registered User
    Join Date
    09-04-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Select lines of data that contain words from column F drop down

    The part that is hilighted is in the 4th line

    Please Login or Register  to view this content.

    ER

  12. #12
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Select lines of data that contain words from column F drop down

    That is telling me you don't have a sheet named Sheet10.

    You can also remove...
    Please Login or Register  to view this content.
    ...it is not necessary.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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