Copy Cell Address to Another Worksheet With Paste Special Syntax Error

theteerex

Board Regular
Joined
Mar 2, 2018
Messages
102
I am trying to copy a cell address when I copy it to a new worksheet.
When I copy usually, all I get is the value of the cell.
I tried to use Paste Special, highlighted in red, but it didn't work.

Code:
Option Explicit


Sub FindProjectName()
Dim LaR As Long
Dim NP As Long
Dim MasterTemplate As Range
Dim MR As Long


MR = Worksheets("Database").Range("MasterTemplate").Rows.Count 
LR = Sheets("Projects").Cells(Rows.Count, "B").End(xlUp).Row 
NP = Sheets("Database").Cells(Rows.Count, "C").End(xlUp).Row 


Sheets("Projects").Cells(LastRow, "B").Copy
Sheets("Database").Cells(Newproject - Masterrow + 1, "C")[B][COLOR=#ff0000].PasteSpecial Link:=True[/COLOR][/B]



End Sub

I get a runtime error 1004
Application defined error.

Could I please get some help figuring out the syntax here?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
It's not clear why you would copy the address, but if you must, here is a line of code to start with:

Code:
Sheets("Database").Cells(5, "C") = Sheets("Projects").Cells(6, "B").Address

This is not a copy, but it gets the address into the cell.

You will have to worry about getting the correct row values.
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

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