Sunday, March 27, 2016

[Solved] 2007 Excel Macro - Error on "Selection.Insert Shift:=xlDown" line

2007 Excel Macro - Error on "Selection.Insert Shift:=xlDown" line

2007 Excel Macro - Trying to write a macro to copy a selection (say A3: L19), and paste that below (with say a row space).  I'm going to link the macro to a button on the worksheet, so, this process needs to find the next free row each time the button is
clicked.  I have tried utilising a macro which works on another workbook, but is failing on this new workbook around the following issue - "Selection.Insert Shift:=xlDown" line - reporting a "Run-time error '1004' - This selection is not valid". 
Current code as follows:
 
ActiveSheet.Unprotect
Range("A3:L19").Select
Selection.Copy
Application.Goto Reference:="R4C1"
Selection.Insert Shift:=xlDown
ActiveSheet.Protect
Any thoughts would be appreciated. 
 
Thanks

Keys to the Problem 2007 Excel Macro - Error on "Selection.Insert Shift:=xlDown" line

Download Error Fixer (Free)

...
Trying to write a macro to copy a selection (say A3: L19), and paste that below (with say a row space) ...

Your code snippet seems to differ from your description of the events to take place.
According to your description, try this,
    ActiveSheet.Unprotect
    Range("A3:L19").Copy Destination:=Cells(Rows.Count, "A").End(xlUp).Offset(2, 0)
    ActiveSheet.Protect

The Offset(2,0) leaves a blank row before pasting the copied cells.
If no blank row is desired, use Offset(1,0) for the first blank row.

Run CHKDSK

  • Go to the Start button.
  • In the Search box, type "cmd" (without quotes) and press Enter.
  • At the command prompt, type "chkdsk /r /f" (without quotes) and press Enter.
  • Reboot your computer.
NOTE: You might receive an error message that states:

"Access denied as you do not have significant privileges. You have to invoke this utility in elevated mode."

If you receive the above error message, it means you are not logged into you computer as an Administrator. If that's the case, follow these steps to run the command prompt in elevated mode:

  • Go to theStart button.
  • Go to "All Programs > Accessories" and right click on "Command Prompt".
  • Select "Run as Administrator".
  • In the Search box, type "cmd" (without quotes) and press Enter.
  • At the command prompt, type "chkdsk /r /f" (without quotes) and press Enter.
  • Reboot your computer.

Recommended Method to Fix the Problem: 2007 Excel Macro - Error on "Selection.Insert Shift:=xlDown" line:

How to Fix 2007 Excel Macro - Error on "Selection.Insert Shift:=xlDown" line with SmartPCFixer?

1. Click the button to download SmartPCFixer . Install it on your computer.  Open it, and it will scan your system. The errors will be shown in the scan result.

2. After the scan is done, you can see the errors and problems need to be repaired. Click Fix All.

3. The Fixing part is finished, the speed of your computer will be much higher than before and the errors have been fixed.


Related:
Read More: Troubleshoot:1: System Restore Error 0x80042318__2: Windows Media Player 11 Will not open__3: Internet Explorer 8 Freezes as soon as opened. Error,Troubleshooting:2007 Excel - Check Register feature Error,15 windows updates all failed to install [Anwsered],How to Fix Problem - 1628: failed to complete installation - Can't Update a Game - Win7 x64?,How Can You Fix - 64-bit Windows 7 Ultimate very slow navigate?,20-22 minute boot-up times - What have I not tried?,15871 blockpage error message. I can't get into facebook. How can I get this blockpage removed?,3.46gb ram usable but 8gb installed,6x9 envelope BUG,40 second boot delay

No comments:

Post a Comment