get the cells that has no formula

Svgmassive

Board Regular
Joined
Nov 2, 2010
Messages
113
i would like to get to set a range based on cells that has no formula in a range how can i achieve this.thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Try

Code:
Set r = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
 
Upvote 0
Messier than you'd think.
Code:
Sub x()
    Dim r1 As Range, r2 As Range
 
    Set r1 = Range("A1:J10")
 
    On Error Resume Next
    
    Set r2 = r1.SpecialCells(xlCellTypeConstants)
    If r2 Is Nothing Then
        Set r2 = r1.SpecialCells(xlCellTypeBlanks)
    Else
        Set r2 = Union(r2, r1.SpecialCells(xlCellTypeBlanks))
    End If
    
    On Error GoTo 0
 
    If r2 Is Nothing Then
        MsgBox "No non-formula cells found"
    Else
        MsgBox r2.Address
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

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