+ Reply to Thread
Results 1 to 4 of 4

VBA Question

  1. #1
    Registered User
    Join Date
    10-26-2006
    Posts
    26

    VBA Question

    How can I used the following code (which works) to cut the cell beside AMI Access and move it to the right also?
    and loop through the entire sheet?

    Set rngFound = Cells.Find(What:="AMI Access", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False)

    rngFound.Cut Destination:=rngFound.Offset(-1, 1)
    Set rngFound = Nothing

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You must wrap your code on the Forum, it makes it easier to read & copy.

    What exactly do you want to do when you loop through the ?
    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-26-2006
    Posts
    26
    I have a worksheet that has multiple data that I need to copy 2 cells (side by side) and move up 1 row and over 2 cells.

    I just can't figure it out how to do it. THe code I pasted isn't working the way I want it to.

    Thanx

  4. #4
    Valued Forum Contributor
    Join Date
    08-26-2006
    Location
    -
    MS-Off Ver
    2010
    Posts
    388
    The Resize property will extend rngFound -
    Please Login or Register  to view this content.
    For the looping look at the FindNext method.
    There is a nice little example in VBA help that you can use as a framework.

+ 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