Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How can I click on a cell and enter a default value?

I would like to be able to click on a cell and have a value automatically
entered. I would like this to work like a forms control checkbox. Or is my
only answer use the control checkbox?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default How can I click on a cell and enter a default value?

Try using

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$E$2" Then Target = 234
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
I would like to be able to click on a cell and have a value automatically
entered. I would like this to work like a forms control checkbox. Or is
my
only answer use the control checkbox?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How can I click on a cell and enter a default value?

Don,

Thanks for the quick reply but i have never worked with VB and am not sure
what to do once I put the code in.

"Don Guillett" wrote:

Try using

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$E$2" Then Target = 234
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
I would like to be able to click on a cell and have a value automatically
entered. I would like this to work like a forms control checkbox. Or is
my
only answer use the control checkbox?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How can I click on a cell and enter a default value?

Thanks Don. One more question. If I put an "X"instead of a number it
doesn't insert anything.

"Don Guillett" wrote:

Right click the sheet tabview codecopy/paste this.
Now when you select cell E2 the number 234 will appear in that cell.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
Don,

Thanks for the quick reply but i have never worked with VB and am not sure
what to do once I put the code in.

"Don Guillett" wrote:

Try using

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$E$2" Then Target = 234
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
I would like to be able to click on a cell and have a value
automatically
entered. I would like this to work like a forms control checkbox. Or
is
my
only answer use the control checkbox?






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default How can I click on a cell and enter a default value?

You could use a double-click event instead.

Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)
If Target.Address = "$E$2" Then Target = 234
Cancel = True
End Sub


Gord Dibben MS Excel MVP

On Mon, 26 Jan 2009 13:42:33 -0800, PawlingJohn
wrote:

One last question. How can i do this so that only a click will insert the
desired input. Now whenever i tab past the field the value goes into it.

"Don Guillett" wrote:

Glad you got it figured out.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
Opps!!! I have to put the X in quotes.

Thanks a millions Don.

"Don Guillett" wrote:

Right click the sheet tabview codecopy/paste this.
Now when you select cell E2 the number 234 will appear in that cell.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
Don,

Thanks for the quick reply but i have never worked with VB and am not
sure
what to do once I put the code in.

"Don Guillett" wrote:

Try using

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$E$2" Then Target = 234
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
I would like to be able to click on a cell and have a value
automatically
entered. I would like this to work like a forms control checkbox.
Or
is
my
only answer use the control checkbox?







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I type data into a cell that changes when I click enter - why? cruiser Excel Discussion (Misc queries) 2 March 30th 07 12:49 AM
How to make the current date appear when i click 'enter' in a cell Matt_07 Excel Worksheet Functions 1 January 30th 07 09:32 AM
Enter Text in Cell on Click Steven Drenker[_7_] Excel Programming 2 January 26th 06 09:21 PM
enter data in cell but cannot save until click off cell in excel T70McCains Excel Discussion (Misc queries) 1 November 18th 05 05:06 PM
WHY DO I HAVE TO CLICK ON THE CELL & ENTER FOR THE VLOOKUP TOWORK Half Manx Excel Discussion (Misc queries) 4 September 29th 05 12:12 PM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"