Friday, 23 September 2016

Troubleshooting:Copy/Paste macro Error

Copy/Paste macro

Hi! Can someone walk me through how to do the following in VBA?

I have a list of data that is 5 columns wide and n rows long. 
I want to be able to highlight the data over 5 columns and however many rows I'd like, but not to exceed 35 rows.
Once selected, I want to be able to hit a hotkey and have a macro paste just the values of the selection into a box that is a range of 
cells in the same sheet - ("C2:G35").
And then delete the original selection that I pasted. 

I don't know how to say this in VBA and I cant yet navigate through the errors I'm getting.
But I think the code should look roughly like:

If selection.rows.count<=35
  and selection.columns.count=5
 then selection.copy
.range("C2").pastespecial paste:=xlvalues
selection.delete

end sub

Thank you for the help.

Solutions to the Problem Copy/Paste macro

Download SmartPCFixer for Free Now

Please note that C2:G35 contains only 34 rows.
Can the selection be any range of 5 columns and at most 35 rows? Or should it be within columns C:G? If it can be anywhere:
 
Sub MoveSelection()
    Dim rngSrc As Range
    Dim rngDst As Range
    Set rngSrc = Selection
    If rngSrc.Rows.Count <= 35 And rngSrc.Columns.Count = 5 Then
        Set rngDst = Range("C2").Resize(rngSrc.Rows.Count, 5)
        If Intersect(rngSrc, rngDst) Is Nothing Then
            rngSrc.Copy
            rngDst.PasteSpecial Paste:=xlPasteValues
            rngSrc.ClearContents
        Else
            MsgBox "Source range overlaps destination range!", vbExclamation
        End If
    Else
        MsgBox "Source range doesn't have correct dimensions!", vbExclamation
    End If
End Sub

Manually editing the Windows registry

Manually editing the Windows registry to remove invalid MACHINE_CHECK_EXCEPTION keys is not recommended unless you are PC service professional. Incorrectly editing your registry can stop your PC from functioning and create irreversible damage to your operating system. In fact, one misplaced comma can prevent your PC from booting entirely!


Caution: Unless you an advanced PC user, we DO NOT recommend editing the Windows registry manually. Using Registry Editor incorrectly can cause serious problems that may require you to reinstall Windows. We do not guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

To manually repair your Windows registry, first you need to create a backup by exporting a portion of the registry related to MACHINE_CHECK_EXCEPTION (eg. Windows Operating System):

  • Click the Start button.
  • Type "command" in the search box... DO NOT hit ENTER yet!
  • While holding CTRL-Shift on your keyboard, hit ENTER.
  • You will be prompted with a permission dialog box.
  • Click Yes.
  • A black box will open with a blinking cursor.
  • Type "regedit" and hit ENTER.
  • In the Registry Editor, select the Error 0x9C-related key (eg. Windows Operating System) you want to back up.
  • From the File menu, choose Export.
  • In the Save In list, select the folder where you want to save the Windows Operating System backup key.
  • In the File Name box, type a name for your backup file, such as "Windows Operating System Backup".
  • In the Export Range box, be sure that "Selected branch" is selected.
  • Click Save.
  • The file is then saved with a .reg file extension.
  • You now have a backup of your MACHINE_CHECK_EXCEPTION-related registry entry.

Another Safe way to Repair the Problem: Copy/Paste macro:

How to Fix Copy/Paste macro with SmartPCFixer?

1. Click the button to download SmartPCFixer . Install it on your system.  Open it, and it will perform a scan for your computer. The junk files will be shown in the list.

2. After the scan is finished, 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 removed.


Related: How Can You Update & Download NVidia 6100, 6800 GS/XT Display Driver v.260.89 WHQL,Where to Download NVidia GeForce 8800 GT WHQL-certified driver v.196.21,How to Update & Download NVidia GeForce Go 7400 Display Driver v.260.19.12,[Solved] Download NVidia GeForce GTX 460M Driver v.331.82,Download NVidia Quadro Plex Model IV VGA Driver v.304.43 Certified,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.8.17.12.6686,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.11.6.0.1030,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.9.3.0.1019,Method to Update & Download ASUS K41VD Intel INF Update Driver v.9.1.1.1015,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver
Read More: Solution to Error: convert a cells text to basic html code,Constant Refresh Tech Support,Fast Solution to Error: Could not Connect To the Internet (wired connection),Troubleshooting:Creating a list from data Error,CTRL V not working! Please help! Tech Support,Closing Internet Explorer causes error,Compare 2 Tables and Calculate the PROFIT Faster,Computer goes to Windows Boot Manager after Start,Connect to one of my network computer remotely when don't allow exception box Marked,computer locking up randomly

No comments:

Post a Comment