Here is how my code currently works:
On sheet 1 at location B5, the value of the cell is Dog. On sheet 2, C15, the paste location, the value is also Dog.
What I would like is for C15 to be =$B$5. This way, I can change B5 on just sheet 1 and C15 on sheet 2 changes as well.
I thought I could use a paste special but can't find any that would work since it's not really a paste function.
How would I go about modifying my code, highlighted in red to add this functionality?
Current code:
On sheet 1 at location B5, the value of the cell is Dog. On sheet 2, C15, the paste location, the value is also Dog.
What I would like is for C15 to be =$B$5. This way, I can change B5 on just sheet 1 and C15 on sheet 2 changes as well.
I thought I could use a paste special but can't find any that would work since it's not really a paste function.
How would I go about modifying my code, highlighted in red to add this functionality?
Current code:
Code:
Sub FindProjectName()
Dim LastRow As Long
Dim Newproject As Long
Dim MasterTemplate As Range
Dim Masterrow As Long
'MasterTemplate is the database entry template.
Masterrow = Worksheets("Database").Range("MasterTemplate").Rows.Count
LastRow = Sheets("Projects").Cells(Rows.Count, "B").End(xlUp).Row
Newproject = Sheets("Database").Cells(Rows.Count, "C").End(xlUp).Row
[B][COLOR=#ff0000]Sheets("Projects").Cells(LastRow, "B").Copy Sheets("Database").Cells(Newproject - Masterrow + 1, "C")[/COLOR][/B]
With Sheets("Database")
.Range("DBASE").Rows(1).Copy
.Range("DBASE").Rows(Newproject - Masterrow).PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End With
End Sub