+ Reply to Thread
Results 1 to 6 of 6

Using Find then cut with offset in VBA

  1. #1
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Using Find then cut with offset in VBA

    Hello VBA guru's!!! I have a question regarding find cut and offset...

    I'm trying to use Find to search for a word (Total), using xlpart and then moving or cutting the entire cell contents over one column. I'm using the below code but I'm not sure how the syntax would go here when using the cut.desination(offset,0,1) - - I'm close I think...but a little stumped.

    Please Login or Register  to view this content.
    Thanks and have a great day!
    Last edited by Ironman; 03-03-2011 at 03:12 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Using Find then cut with offset in VBA

    Perhaps this will help?
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Using Find then cut with offset in VBA

    One thing you have to be carefull of is that it doen't find it in the new place and try to replace that as well... here's my sol'n

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Using Find then cut with offset in VBA

    Thanks StephenR, I tried your code suggestion and it errored out on ReplaceFormat=true. I commented that out and reran and it seemed to work, except it moves only the first occurance where total is found, there would be more in the sheet. Sorry, if I wasn't clear about that. Would I be able to add in a loop or something? Like

    Do isearch = ""

    Loop

    With your suggested code between? Thanks again for your quick reponse!

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Using Find then cut with offset in VBA

    The loop in nimrod's code covers multiple finds so see if that does the trick. I hadn't noticed, but ReplaceFormat is not a valid parameter.

  6. #6
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Using Find then cut with offset in VBA

    Thanks to you both, StehphenR and nimrod - - nimrods worked perfectly!

    Have a great day and thanks again.

    iron

+ 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