Hi all trying to join SpecialCells(xlConstants) with SpecialCells(xlFormulas)

Pfereday

New Member
Joined
Mar 17, 2012
Messages
36
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Hi all I'm trying to join SpecialCells(xlConstants) with SpecialCells(xlFormulas) and no matter what I [/FONT]try I can only one or the other to work never both.

HTML:
Sub Done()
Dim NR As Long
Application.ScreenUpdating = False
Application.EnableEvents = False
With Sheets("Your Quotation")
    NR = .Range("D" & .Rows.Count).End(xlUp).Row + 1
    If NR > 149 Then NR = NR + 1    .Range("C" & NR).Resize(, 1).Value = Range("B:C").Value
    
    
    Range("A:A").SpecialCells(xlConstants & xlFormulas).Offset(, 2).Copy .Range("C" & NR)
    Range("A:A").SpecialCells(xlConstants).Offset(, 3).Copy .Range("D" & NR)
    Range("E:E").SpecialCells(xlConstants).Offset(, 1).Copy .Range("D" & NR)
    
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
Beep
End Sub
 
Code:
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Sub Done()
Dim NR As Long
Application.ScreenUpdating = False
Application.EnableEvents = False
With Sheets("Your Quotation")
    NR = .Range("D" & .Rows.Count).End(xlUp).Row + 1
    If NR > 149 Then NR = NR + 1[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]    
    
    Union(Range("A:A").SpecialCells(xlConstants), Range("A:A").SpecialCells(xlFormulas)).Offset(, 2).Copy .Range("C" & NR)
    Union(Range("A:A").SpecialCells(xlConstants), Range("A:A").SpecialCells(xlFormulas)).Offset(, 3).Copy .Range("D" & NR)
    
    Range("E:E").SpecialCells(xlConstants).Offset(, 1).Copy .Range("D" & NR)
    
    
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
Beep
End Sub[/FONT]

All working now thanks for your help it greatly appreciated
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Glad you've sorted it & thanks for the feedback.

WE don't mark threads as solved on here.
 
Upvote 0

Forum statistics

Threads
1,225,740
Messages
6,186,759
Members
453,370
Latest member
juliewar

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