Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: DELETE FORMULES

  1. #21
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-26 16:38, Amds wrote:
    On 2002-03-26 15:52, verluc wrote:
    On 2002-03-26 15:43, Barrie Davidson wrote:
    Here is the complete macro,who is in my program:Sub Copy()
    Sheets("Portefeuille").Select
    Range("IV1").End(xlToLeft).Offset(0, -1).EntireColumn.Insert
    Range(Range("IV1").End(xlToLeft).Address, _
    Range("IV1").End(xlToLeft).End(xlDown). _
    Address).Copy
    Range("IV1").End(xlToLeft).Offset(0, -1).PasteSpecial _
    Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    Application.CutCopyMode = False
    End Sub

    It is on the first Range("IV1") that I receive the error.
    Many thanks
    Do you have anything in cell B1? I'm betting not; if you only have something in cell A1, the macro is trying to go to the left of cell A1.

    Range("IV1").End(xlToLeft).Offset(0, -1)

    This code will go to the column left of the rightmost column of data in row 1. For example, if your rightmost cell is C1, it will go to cell B1. As you can see, you will get an error if your rightmost cell (in row 1) is A1.

    Am I correct?

    Great, It works.Many,Many thanks.


    Re the line that reads :-
    Range("IV1").End(xlToLeft).Offset(0, -1).EntireColumn.Insert

    Should this not be :-
    Range("IV1").End(xlToLeft)).EntireColumn.Insert


    The complete code could be simplified to :-

    With Sheets("Portefeuille").Range("IV1").End(xlToLeft).EntireColumn
    .Insert
    .Offset(0, -1) = .Value
    End With







    O.K.This macro works perfect.But still one question about insert row.
    Is it possible that the row that will be insert each time the same row is ex.Row C
    and that all the other rows change one row to the right.So I can follow each day the evolution of the stock market.
    Thanks

  2. #22
    New Member
    Join Date
    Mar 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Not sure I understand what you want.

    Check whether this does it :-

    With Sheets("Portefeuille").Columns(3)
    .Insert
    .Offset(0, -1) = Columns(2).Value
    End With

  3. #23
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-27 05:34, Abcd wrote:
    Not sure I understand what you want.

    Check whether this does it :-

    With Sheets("Portefeuille").Columns(3)
    .Insert
    .Offset(0, -1) = Columns(2).Value
    End With
    Yes,that's what I mean.
    Many thanks.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •