![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
Hi Group,
I'm trying come up some code that on commandbutton_click will read sheet1 & sheet2 and clear the cells that have the result of a formula, not any text or formulas. Any help would be appreciated Jim _________________ [ This Message was edited by: James on 2002-05-20 19:38 ] |
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Apr 2002
Location: Kissimmee, Florida
Posts: 384
|
Quote:
A very quick way of doing this would be to copy the whole sheet and paste values Code:
Sub turnoff()
Sheets("Sheet1").select
Cells.Copy
Cells.PasteSpecial xlPasteValues
Sheets("Sheet2").select
Cells.Copy
Cells.PasteSpecial xlPasteValues
End Sub
__________________
Hope This Helps. Sean. Digest of Homes WinXP, XL XP |
|
|
|
|
|
|
#3 | |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
James, by
Quote:
Do you have a clean range of precedants? Am I remotely following your post? |
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
Hi Nate,
Yes, that's what i'm trying to accomplish. Regards, James |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
constants in the sheets ?? will this do it Sub FrmClr_precedents() '// Just clears Constants ' const = Numbers, On Error Resume Next Sheets("Sheet1").Cells.SpecialCells(2, 21).ClearContents Sheets("Sheet2").Cells.SpecialCells(2, 21).ClearContents On Error GoTo 0 End Sub |
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi
If Ivans code works, then use it. However, Ivan's code will clear cells which are not Precendents as well. This will only clear Precedents:
Tom |
|
|
|
|
|
#7 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Numeric constants. Good one Ivan!
I had been playing with:
But what I found and did not like is that it won't clear precedents from other sheets. May have to do some more homework....Have a good one. _________________ Cheers, NateO [ This Message was edited by: NateO on 2002-05-20 19:03 ] |
|
|
|
|
|
#8 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
Tom's in on it too. A bunch of ideas, hope they are of help James.
|
|
|
|
|
|
#9 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
I looked @ the precedents method BUT like you said, it doesn't seem to support formulas from Diff sheets...work around ?? look further......cheers Nate & Tom |
|
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
Hi group,
Thanks for the replys. I jumped at Ivans, and it works. Although i will try them all. Regards, James |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|