Copying "=today()" function from one sheet to second one?

Ronix

Board Regular
Joined
Aug 18, 2014
Messages
54
Hi Guys, with this code below I am copying row 3 from first sheet to the second one. First cell A3 contains "=today()" function and automatically is copied to second sheet where data archive is. So I dont wanna copy function of A3 cell of first sheet but only its value to the second sheet. How can I secure this in this code below?
Sub Makro1()

If Sheets(1).Range("A4") = "" Then
PR1 = 3
Else: PR1 = Sheets(1).Range("A3").End(xlDown).Row
End If
If Sheets(2).Range("A4") = "" Then
PR2 = 3
Else: PR2 = Sheets(2).Range("A3").End(xlDown).Row
End If

For i = 3 To PR1
For j = 3 To PR2
If Sheets(1).Range("A" & i) = Sheets(2).Range("A" & j) And Sheets(1).Range("B" & i) = Sheets(2).Range("B" & j) And Sheets(1).Range("C" & i) = Sheets(2).Range("C" & j) Then
Sheets(2).Range("E" & j) = Sheets(2).Range("E" & j) + Sheets(1).Range("E" & i)
Sheets(2).Range("F" & j) = Sheets(2).Range("F" & j) + Sheets(1).Range("F" & i)
Sheets(2).Range("G" & j) = Sheets(2).Range("G" & j) + Sheets(1).Range("G" & i)
GoTo DalsieI
End If
Next j
Sheets(1).Range("A" & i & ":G" & i).Copy (Sheets(2).Range("A" & (PR2 + 1)))
PR2 = PR2 + 1
DalsieI:
Next i

Sheets(2).Select
End Sub
Thanks in advance!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Maybe:

Rich (BB code):
Sheets(1).Range("A" & i & ":G" & i).Copy (Sheets(2).Range("A" & (PR2 + 1)))
With Sheets(2).Range("A" & (PR2 + 1))
    .Value = .Value
End With
 
Upvote 0

Forum statistics

Threads
1,224,396
Messages
6,178,394
Members
452,844
Latest member
Shebl

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