Friday 23 September 2016

How to Fix Problem - Creating a macro to copy a named range in a variable location?

Creating a macro to copy a named range in a variable location

I want to perform a simple task in Visual Basic, but can't figure it out.  I want to start with a named range of cells (want to use an Excel named range rather than referencing specific cells because new columns will be added later to file).  I want to create
a macro that simply copies this range down n number of rows from the row where the named range is, where
n is a variable that can change.  I have tried using Offest and Cells referencing, with named ranges, but nothing is working
 
ActiveCell.Range("A1:D1").Select
    Selection.Copy
    ActiveCell.Offset("paste_row_number2", 0).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
OR
Worksheets("Port Opt Waves").Cells("paste_row_number2", 0).Select
 
Any suggestions?

Solutions to the Problem Creating a macro to copy a named range in a variable location

Download SmartPCFixer to Fix It (Free)

Hi,
copy down n rows
try this..

Sub abc()
n = 10
Range("rngName").Copy Destination:=Range("rngName").Resize(n+1)
End Sub

Make Sure that your System Meets the System Requirements

This error can be due to some configuration requirements for you system. If your computer hardware is not up to par, then make sure you update where necessary before continuing:

Microsoft Windows Requirements :

  • 1 gigahertz (GHz) or faster 32-bit (x86) or 64-bit (x64) processor
  • 16 GB available hard disk space (32-bit) or 20 GB (64-bit)

Recommended Method to Repair the Problem: Creating a macro to copy a named range in a variable location:

How to Fix Creating a macro to copy a named range in a variable location with SmartPCFixer?

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

2. After the scan is finished, you can see the errors and problems which need to be repaired.

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


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: Fast Solution to Error: Cross Reference,Solution to Error: Create a custom Multilevel List,Troubleshooting:Copying formulas Error,Tech Support: Counting unique ID's?,Troubleshoot:Corel Draw 10 problems.,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