![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: Mar 2002
Posts: 16
|
Any one see an immediate problem with this macro? Im trying to get it to delete some data. The cell links are definatly right and it doesnt give any errors, it just does nothing.
Sub Button59_Click() If Range("E6") = "1" Then If Range("F18") = Range("B7") Then Range("B7") = "" Range("C7") = "" End If End If End Sub thx |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Quote:
Two things for you to try that might help... 1. The first test only clears the sheets if Range("E6") is a string "1" and *not* a numeric 1. I am guessing that you want to test the value, not the string. 2. Reference the worksheet, although I don't think this is the cause of your problem. With Sheets("Sheet1") If .Range("E6") = 1 Then If .Range("F18") = .Range("B7") Then .Range("B7") = "" .Range("C7") = "" End If End If End With Change the sheet to your sheet name, or its index, and you should be fine (I hope). If it doesn't work, please post pack. HTH, Jay |
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 16
|
Yeah still no luck! "1" is a value and not a string.. The most annoying thing is the exact code works fine on a friends piece, so im starting to think its nothing to do with the Macro :S
|
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
Sub Button59_Click() If Range("E6").value = 1 Then If Range("F18").value = Range("B7").value Then Range("B7") = "" Range("C7") = "" End If End If End Sub |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|