ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   free cell (https://www.excelbanter.com/excel-programming/358699-free-cell.html)

Gary''s Student

free cell
 
How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the worksheet.

--
Gary''s Student

Duke Carey

free cell
 
check the cell's Dependent property

"Gary''s Student" wrote:

How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the worksheet.

--
Gary''s Student


Gary''s Student

free cell
 
thanks
--
Gary''s Student


"Duke Carey" wrote:

check the cell's Dependent property

"Gary''s Student" wrote:

How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the worksheet.

--
Gary''s Student


Bob Phillips[_6_]

free cell
 
Dim fEmpty
Dim tmp As Range
fEmpty = IsEmpty(ActiveCell)
If fEmpty Then
On Error Resume Next
Set tmp = ActiveCell.DirectPrecedents
On Error GoTo 0
If Not tmp Is Nothing Then
fEmpty = False
End If
On Error Resume Next
Set tmp = ActiveCell.DirectDependents
On Error GoTo 0
If Not tmp Is Nothing Then
fEmpty = False
End If
End If


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gary''s Student" wrote in message
...
How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the

worksheet.

--
Gary''s Student




Gary''s Student

free cell
 
Thank you Bob, for both the answer and the general approach of using On
Error. I will use this in the future instead of my (Homer Simpson) usual
practice of banging my head into a wall until a 1004 error pops up.
--
Gary's Student


"Bob Phillips" wrote:

Dim fEmpty
Dim tmp As Range
fEmpty = IsEmpty(ActiveCell)
If fEmpty Then
On Error Resume Next
Set tmp = ActiveCell.DirectPrecedents
On Error GoTo 0
If Not tmp Is Nothing Then
fEmpty = False
End If
On Error Resume Next
Set tmp = ActiveCell.DirectDependents
On Error GoTo 0
If Not tmp Is Nothing Then
fEmpty = False
End If
End If


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gary''s Student" wrote in message
...
How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the

worksheet.

--
Gary''s Student





John Lyons

free cell
 
or just use the Find Dependents tool on the Audit toolbar!

"Gary''s Student" wrote:

How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the worksheet.

--
Gary''s Student


Bob Phillips[_6_]

free cell
 
Some of still use 2000 <vbg

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"John Lyons" wrote in message
...
or just use the Find Dependents tool on the Audit toolbar!

"Gary''s Student" wrote:

How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the

worksheet.

--
Gary''s Student




Duke Carey

free cell
 
Trace Dependents/Precedents icons are available in 2000 (and '97, I think)
when you customize the toolbar & look in the Tools category<g


"Bob Phillips" wrote:

Some of still use 2000 <vbg

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"John Lyons" wrote in message
...
or just use the Find Dependents tool on the Audit toolbar!

"Gary''s Student" wrote:

How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the

worksheet.

--
Gary''s Student





Bob Phillips[_6_]

free cell
 
You are right, I had forgotten since I never use them, and was thinking of
the much stronger Evaluate facility in the XP Auditing tool <g

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Duke Carey" wrote in message
...
Trace Dependents/Precedents icons are available in 2000 (and '97, I think)
when you customize the toolbar & look in the Tools category<g


"Bob Phillips" wrote:

Some of still use 2000 <vbg

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"John Lyons" wrote in message
...
or just use the Find Dependents tool on the Audit toolbar!

"Gary''s Student" wrote:

How can I tell if a cell is free (available)?
Free would mean empty and not referred to by another cell on the

worksheet.

--
Gary''s Student








All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com