Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Problem inserting rows (and cutting)

Hello

I got a macro to fix, which has worked.

The original code was:

Columns("M:M").Select
Selection.Cut
Range("L1").Select ' was L1
Selection.Insert Shift:=xlToRight

I tried this also:
Range("L1").Select
DoEvents
Range("L1").Insert

and both gives the error:

Runtime error 1004
Insert method of Range class failed.

What can cause this?

WBR
Sonnich
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Problem inserting rows (and cutting)

On Jan 8, 7:22*pm, jodleren wrote:
Hello

I got a macro to fix, which has worked.

The original code was:

* * Columns("M:M").Select
* * Selection.Cut
* * Range("L1").Select ' was L1
* * Selection.Insert Shift:=xlToRight

I tried this also:
* * Range("L1").Select
* * DoEvents
* * Range("L1").Insert

and both gives the error:

Runtime error 1004
Insert method of Range class failed.

What can cause this?

WBR
Sonnich


Adding this does not help

For aa = 1 To ActiveWorkbook.Worksheets.Count
ActiveWorkbook.Worksheets(aa).Unprotect
Next

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Problem inserting rows (and cutting)

On Jan 8, 7:33*pm, jodleren wrote:
On Jan 8, 7:22*pm, jodleren wrote:



Hello


I got a macro to fix, which has worked.


The original code was:


* * Columns("M:M").Select
* * Selection.Cut
* * Range("L1").Select ' was L1
* * Selection.Insert Shift:=xlToRight


I tried this also:
* * Range("L1").Select
* * DoEvents
* * Range("L1").Insert


and both gives the error:


Runtime error 1004
Insert method of Range class failed.


What can cause this?


WBR
Sonnich


Adding this does not help

* * For aa = 1 To ActiveWorkbook.Worksheets.Count
* * * ActiveWorkbook.Worksheets(aa).Unprotect
* * Next


I made this up:

Range("L1").Select
Columns("L:L").Insert
Columns("N:N").Select
Selection.Cut
ActiveSheet.Paste Destination:=ActiveSheet.Range("L:L")

This works.

Any better ideas?

Sonnich
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in inserting rows Amol Excel Discussion (Misc queries) 1 October 24th 09 07:36 AM
Cutting rows in excel Grouping Data[_2_] Excel Discussion (Misc queries) 0 October 27th 07 09:23 AM
Cutting rows and inserting in another sheet Karen Bates Excel Discussion (Misc queries) 5 May 23rd 07 08:23 PM
Reference Problem w/ inserting rows Paul987 Excel Discussion (Misc queries) 5 May 25th 06 10:30 AM
Problem encountered when cutting and pasting limws1 Excel Discussion (Misc queries) 2 July 18th 05 10:45 AM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"