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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Are you sure that's all the code?

Seems to be something missing at the start.:)
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

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
Back
Top