+ Reply to Thread
Results 1 to 4 of 4

VBA programming help needed

  1. #1
    Registered User
    Join Date
    06-13-2014
    Posts
    2

    VBA programming help needed

    Hello,

    I started to program VBA with excel.

    I have a list with ~166000 lines and 12 columns.

    I want to find the Name Willi in the 4th column and only in the 4th column. If it is found, it should be cutted and pasted in a different sheet. Should it exist in another column it doesn't interest.

    Until now the following program

    -------------------------------------------------------------------------------------

    Sub Willi()
    '
    ' Willi Makro
    '

    '
    Dim I As Integer
    I = 1
    Do
    Cells.Find(What:="Willi", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
    :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False).Activate
    ActiveCell.Rows("1:1").EntireRow.Select
    ActiveCell.Rows("1:1").EntireRow.Select
    Selection.Cut
    Sheets("Endergebnis").Select
    ActiveSheet.Paste
    ActiveCell.Offset(1, 0).Range("A1").Select
    Sheets("Haupttabelle").Select
    I = I + 1
    Loop While ActiveCell.Rows("1:1").EntireRow.Select <> "Falsch"
    MsgBox I
    End Sub

    -------------------------------------------------------------------------------------

    finds all "Willi" in each column and ends with

    Runtime error '91'
    Objectvariable or with-variable not set

    It would be very kindly if somebody would show me my mistakes. I'm not experienced enough to find them myself.

    Thanks and best regards

    Willi

  2. #2
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: VBA programming help needed

    Hi Willi,

    welcome to excel forum!

    try this formula. i prefer to use Data Filter as looping will takes time... considering you have 120000 rows.


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Cheers!

    LEX

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: VBA programming help needed

    Welcome to the forum. Unfortunately.


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    ALSO


    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    06-13-2014
    Posts
    2

    Re: VBA programming help needed

    Hi lexusap,

    thank you for your help. IT WORKS!!! Great.


    And for you Fotis1991,

    I promise improvement in the next request!

    Kindly regards

    Willi

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Conditional formatting needed for shape colour - is programming needed?
    By Farmboyuk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2012, 07:27 AM
  2. Excel/VB programming needed please!!!
    By djdownfawl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2011, 03:34 PM
  3. Pivot Table Programming Needed
    By bluelotus in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2007, 05:09 AM
  4. help needed with excel programming!!!
    By gem.g in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2006, 11:40 AM
  5. Replies: 0
    Last Post: 03-21-2005, 01:06 PM

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