3 simple(!?) problems: activate cell concequence / text formulas

  • Thread starter Thread starter Snoopy
  • Start date Start date
S

Snoopy

Hey guys
I have some minor issues on my board:
1) Are there any way to delete the cell value in range A1 when
activating cell/range A2?
- wanted effect is when user activates cell A2 (by click) the value /
content inn cell A1 will be deleted.
2) When constructing coordinates as textstrings (X Y Z) by linking
values from range B1, B2 and B3 ( the text string will not appear whit
decimal format.
 
#1. Right click sheet tab>view code>insert this. DOUBLE click to fire
#2. More detail?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Address <> Range("b1").Address Then Exit Sub
Range("a1").ClearContents 'Delete
End Sub
 
#1. Right click sheet tab>view code>insert this. DOUBLE click to fire
#2. More detail?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Address <> Range("b1").Address Then Exit Sub
Range("a1").ClearContents 'Delete
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software





– Vis sitert tekst –

Thanks - that was a quick one! But I still dont get it right :(
Right click on sheet tab and paste the macro - right? What did you
meen by "double click to fire"?
Regards
Snoopy
 
Read the instructions again.
You said you wanted to click the cell. This requires a DOUBLE click in b1 to
clear a1
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
#1. Right click sheet tab>view code>insert this. DOUBLE click to fire
#2. More detail?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Address <> Range("b1").Address Then Exit Sub
Range("a1").ClearContents 'Delete
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software





– Vis sitert tekst –

Thanks - that was a quick one! But I still dont get it right :(
Right click on sheet tab and paste the macro - right? What did you
meen by "double click to fire"?
Regards
Snoopy
 
Read the instructions again.
You said you wanted to click the cell. This requires a DOUBLE click in b1to
clear a1
--
Don Guillett
Microsoft MVP Excel
SalesAid Software






Thanks - that was a quick one! But I still dont get it right :(
Right click on sheet tab and paste the macro - right? What did you
meen by "double click to fire"?
Regards
Snoopy– Skjul sitert tekst –

– Vis sitert tekst –

Thats nice! :) Thanks
Are the the same posibility to only activate by one click in this?
Regards Snoopy
 
Fries with that?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
Read the instructions again.
You said you wanted to click the cell. This requires a DOUBLE click in b1
to
clear a1
--
Don Guillett
Microsoft MVP Excel
SalesAid Software






Thanks - that was a quick one! But I still dont get it right :(
Right click on sheet tab and paste the macro - right? What did you
meen by "double click to fire"?
Regards
Snoopy– Skjul sitert tekst –

– Vis sitert tekst –

Thats nice! :) Thanks
Are the the same posibility to only activate by one click in this?
Regards Snoopy
 
You want to clear A1 when you select A2?

Adjust Don's code to this.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address <> Range("A2").Address Then Exit Sub
Range("A1").ClearContents
End Sub


Gord Dibben MS Excel MVP
 
Don's double-click code is better than single-click.

The problem with single-click code is that would also be activated by
getting to A2 with the cursor keys.
 
Back
Top