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
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
How about
Code:
Union(Range("A:A").SpecialCells(xlConstants), Range("A:A").SpecialCells(xlFormulas)).Offset(, 2).Copy Range("C" & nr)
But if you do not have both formulae & constants in the column it will fail
 
Upvote 0
a
a
a
=IF(C4 ="Three section bay","a","")
a
hi all the above are in column a and your union didn't work

<colgroup><col></colgroup><tbody>
</tbody>
 
Upvote 0
In what way "didn't it work"?
 
Upvote 0
Hi only the cell next to the a's copied the next to the formula didn't didn't copy sorry for the slow reply but I have gone for a pint and replying with my phone.
 
Upvote 0
Those cells that didn't copy, are they formulae or hard values?
If formulae did the formula copy over, but now returning ""?
 
Upvote 0
Everything that I am trying to copy is a hard value, it's a pick list and the a,s represent ticks, it was the formula that had a or tick webdings font that is not copying the hard value in the cell next to it all the others a,s or ticks if you prefer copied the appropriate cells next to them.
 
Upvote 0
Are you trying to copy the contents of col B or col C?
 
Upvote 0
Why not just copy the values in the column (maybe intersected with the UsedRange to keep size down) to your new location and then use SpecialCells to delete the blank cells at the copied location shifting everything in the column upwards?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,453
Messages
6,124,918
Members
449,195
Latest member
Stevenciu

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