Paste Problem

woodpecker2

New Member
Joined
Aug 2, 2007
Messages
33
I've created a macro that enter a formula in a cell and should then copy/paste the formula into selected cells within column H.

There are in excess of 20,000 rows that this needs to be copied down to and I keep getting an error message informing me the range is to big.

I need to get the macro to work correctly and am struggling with this issue. Could someone help this novice?

My code is shown below:-

Code:
"=IF(ISNA(VLOOKUP(RC[-7],Table,8,FALSE)),""Error"",VLOOKUP(RC[-7],Table,8,FALSE))"
   Range("H3:I3").Select
   Range("I3").Activate
   ActiveCell.FormulaR1C1 = _
       "Thursday"
   Range("H3:I3").Select
   Selection.Copy
   Range("H3:H" & LastRow3).Select
   ActiveSheet.Paste
   Application.CutCopyMode = False
   Selection.Copy
   Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
       False, Transpose:=False
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,357
Office Version
  1. 365
Platform
  1. Windows
Are you sure that's all the code?

Seems to be something missing at the start.:)
 

woodpecker2

New Member
Joined
Aug 2, 2007
Messages
33
I think this is all the code that is being effected:-

Code:
Dim LastRow1 As Long
Dim LastRow2 As Long
Dim LastRow3 As Long




   LastRow1 = Range("C65536").End(xlUp).Row
   Range("A3").Select
   ActiveCell.FormulaR1C1 = "=RC[2]&"" ""&RC[3]"
   Selection.Copy
   Range("A3:A" & LastRow1).Select
   ActiveSheet.Paste
   Application.CutCopyMode = False
   Selection.Copy
   Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
       False, Transpose:=False

   LastRow2 = Range("L65536").End(xlUp).Row
   Range("K3").Select
   ActiveCell.FormulaR1C1 = "=RC[2]&"" ""&RC[3]"
   Selection.Copy
   Range("K3:K" & LastRow2).Select
   ActiveSheet.Paste
   Application.CutCopyMode = False
   Selection.Copy
   Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
       False, Transpose:=False

   LastRow3 = Range("C65536").End(xlUp).Row
   Range("E3").Select
'    ActiveCell.FormulaR1C1 = _

"=IF(ISNA(VLOOKUP(RC[-4],Table,5,FALSE)),""Error"",VLOOKUP(RC[-4],Table,5,FALSE))"
   ActiveCell.FormulaR1C1 = "m"
   Selection.Copy
   Range("E3:E" & LastRow3).Select
   ActiveSheet.Paste
   Application.CutCopyMode = False
   Selection.Copy
   Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
       False, Transpose:=False
   Range("H3:I3").Select
   Application.CutCopyMode = False
   ActiveCell.FormulaR1C1 = _

"=IF(ISNA(VLOOKUP(RC[-7],Table,8,FALSE)),""Error"",VLOOKUP(RC[-7],Table,8,FALSE))"
   Range("H3:I3").Select
   Range("I3").Activate
   ActiveCell.FormulaR1C1 = _
       "Thursday"
   Range("H3:I3").Select
   Selection.Copy
   Range("H3:H" & LastRow3).Select
   ActiveSheet.Paste
   Application.CutCopyMode = False
   Selection.Copy
   Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
       False, Transpose:=False
 

Forum statistics

Threads
1,181,418
Messages
5,929,793
Members
436,694
Latest member
dpatete

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top