+ Reply to Thread
Results 1 to 9 of 9

How to delete a range and shift the rest up in Vbasic?

  1. #1
    serdar
    Guest

    How to delete a range and shift the rest up in Vbasic?

    Selection.Delete Shift:=xlUp

    This needs a selection first.



  2. #2
    Don Guillett
    Guest

    Re: How to delete a range and shift the rest up in Vbasic?

    The macro recorder can be your friend. Try it

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "serdar" <[email protected]> wrote in message
    news:[email protected]...
    > Selection.Delete Shift:=xlUp
    >
    > This needs a selection first.
    >
    >




  3. #3
    serdar
    Guest

    Re: How to delete a range and shift the rest up in Vbasic?

    nope. i creates this code:

    Selection.Delete Shift:=xlUp

    i want to delete lets say a1 to c3. i can do it with select but i dont want
    selection is shown to the user before deleting the area. i must say smt like
    "shift the list up starting from the 4th row" I tried:

    Range(xxx).Delete Shift:=xlUp

    but this doesn't work.


    "Don Guillett" <[email protected]>, haber iletisinde şunları
    yazdı:[email protected]...
    > The macro recorder can be your friend. Try it
    >
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > "serdar" <[email protected]> wrote in message
    > news:[email protected]...
    > > Selection.Delete Shift:=xlUp
    > >
    > > This needs a selection first.
    > >
    > >

    >
    >




  4. #4
    Don Guillett
    Guest

    Re: How to delete a range and shift the rest up in Vbasic?

    range("a1:c3").Delete Shift:=xlUp
    --
    Don Guillett
    SalesAid Software
    [email protected]
    "serdar" <[email protected]> wrote in message
    news:[email protected]...
    > nope. i creates this code:
    >
    > Selection.Delete Shift:=xlUp
    >
    > i want to delete lets say a1 to c3. i can do it with select but i dont

    want
    > selection is shown to the user before deleting the area. i must say smt

    like
    > "shift the list up starting from the 4th row" I tried:
    >
    > Range(xxx).Delete Shift:=xlUp
    >
    > but this doesn't work.
    >
    >
    > "Don Guillett" <[email protected]>, haber iletisinde şunları
    > yazdı:[email protected]...
    > > The macro recorder can be your friend. Try it
    > >
    > > --
    > > Don Guillett
    > > SalesAid Software
    > > [email protected]
    > > "serdar" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Selection.Delete Shift:=xlUp
    > > >
    > > > This needs a selection first.
    > > >
    > > >

    > >
    > >

    >
    >




  5. #5
    serdar
    Guest

    Re: How to delete a range and shift the rest up in Vbasic?

    Range(x).Delete Shift:=xlUp
    or
    Rows(x).Delete Shift:=xlUp

    These should work but since i dont define the rest of the list, it shifts
    the entire document up.



  6. #6
    serdar
    Guest

    Re: How to delete a range and shift the rest up in Vbasic?

    Ok i tried it with an if statement.

    If Range("a11") = "serdar" Then _
    Rows(10).Delete Shift:=xlUp

    My fault was trying it just in the event function and it continuosly shifts
    the list, true?




  7. #7
    Don Guillett
    Guest

    Re: How to delete a range and shift the rest up in Vbasic?

    I'm still not sure EXACTLY what you want to do???????????

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "serdar" <[email protected]> wrote in message
    news:[email protected]...
    > Ok i tried it with an if statement.
    >
    > If Range("a11") = "serdar" Then _
    > Rows(10).Delete Shift:=xlUp
    >
    > My fault was trying it just in the event function and it continuosly

    shifts
    > the list, true?
    >
    >
    >




  8. #8
    serdar
    Guest

    Re: How to delete a range and shift the rest up in Vbasic?

    Thats ok now, don't get angry with me. Because i wrote a delete command in
    the change event function without a control statement, change event deletes
    and shifts continuosly.


    "Don Guillett" <[email protected]>, haber iletisinde şunları
    yazdı:[email protected]...
    > I'm still not sure EXACTLY what you want to do???????????
    >
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > "serdar" <[email protected]> wrote in message
    > news:[email protected]...
    > > Ok i tried it with an if statement.
    > >
    > > If Range("a11") = "serdar" Then _
    > > Rows(10).Delete Shift:=xlUp
    > >
    > > My fault was trying it just in the event function and it continuosly

    > shifts
    > > the list, true?
    > >
    > >
    > >

    >
    >




  9. #9
    Don Guillett
    Guest

    Re: How to delete a range and shift the rest up in Vbasic?

    Not angry, perplexed... This is the first mention of a change event.
    Use application.enableevents=false

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "serdar" <[email protected]> wrote in message
    news:[email protected]...
    > Thats ok now, don't get angry with me. Because i wrote a delete command in
    > the change event function without a control statement, change event

    deletes
    > and shifts continuosly.
    >
    >
    > "Don Guillett" <[email protected]>, haber iletisinde şunları
    > yazdı:[email protected]...
    > > I'm still not sure EXACTLY what you want to do???????????
    > >
    > > --
    > > Don Guillett
    > > SalesAid Software
    > > [email protected]
    > > "serdar" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Ok i tried it with an if statement.
    > > >
    > > > If Range("a11") = "serdar" Then _
    > > > Rows(10).Delete Shift:=xlUp
    > > >
    > > > My fault was trying it just in the event function and it continuosly

    > > shifts
    > > > the list, true?
    > > >
    > > >
    > > >

    > >
    > >

    >
    >




+ 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