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.