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

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.
 
D

Don Guillett

#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
 
S

Snoopy

#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
 
D

Don Guillett

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
 
S

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
 
D

Don Guillett

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
 
G

Gord Dibben

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
 
G

Gary''s Student

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top