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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,885
Messages
6,181,588
Members
453,055
Latest member
cope7895

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