I'm using the following code to copy and send some data to another worksheet. Columns E and F are hidden AND they contain IF formulas that return a date value. When I use the code below, it appears that they are translated into the destination worksheet as blank columns. My thought is that this has to do with the fact that they are actually formulas, not dates. Is there a way to copy the displayed value instead?
Code:
[SIZE=2][FONT=arial]Sub cpypste7()
Dim x As String
Dim y As String
Dim ws1 As Worksheet: Set ws1 = ThisWorkbook.Sheets("Main Data")
Dim ws2 As Worksheet: Set ws2 = ThisWorkbook.Sheets("P1 Figure 2-2")
Application.ScreenUpdating = False
x = "NO"
y = "TRUE"
If Not IsError(Application.Match(x, ws1.Range("A:A"), 0)) Then
ws1.Range("E:F").EntireColumn.Hidden = False
ws1.Range("A7").AutoFilter Field:=1, Criteria1:=x
ws1.Range("A7").AutoFilter Field:=19, Criteria1:=y
Intersect(ws1.AutoFilter.Range.Offset(1), Union(ws1.Columns("B:C"), ws1.Columns("E:F"), ws1.Columns("H"))).Copy _
Destination:=ws2.Range("A" & Rows.Count).End(xlUp).Offset(1)
ws1.AutoFilterMode = False
ws1.Range("E:F").EntireColumn.Hidden = True
End If
Application.ScreenUpdating = False
End Sub[/FONT][/SIZE]