PC Review


Reply
Thread Tools Rate Thread

How can I click on a cell and enter a default value?

 
 
pawlingJohn
Guest
Posts: n/a
 
      15th Jan 2009
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 With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      15th Jan 2009
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
(E-Mail Removed)
"pawlingJohn" <(E-Mail Removed)> wrote in message
news:56E03EF1-994C-436F-91DD-(E-Mail Removed)...
>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 With Quote
 
pawlingJohn
Guest
Posts: n/a
 
      15th Jan 2009
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
> (E-Mail Removed)
> "pawlingJohn" <(E-Mail Removed)> wrote in message
> news:56E03EF1-994C-436F-91DD-(E-Mail Removed)...
> >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 With Quote
 
Don Guillett
Guest
Posts: n/a
 
      15th Jan 2009
Right click the sheet tab>view code>copy/paste this.
Now when you select cell E2 the number 234 will appear in that cell.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"pawlingJohn" <(E-Mail Removed)> wrote in message
news:F98C03C6-4B9E-42B1-B9F6-(E-Mail Removed)...
> 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
>> (E-Mail Removed)
>> "pawlingJohn" <(E-Mail Removed)> wrote in message
>> news:56E03EF1-994C-436F-91DD-(E-Mail Removed)...
>> >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 With Quote
 
pawlingJohn
Guest
Posts: n/a
 
      15th Jan 2009
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 tab>view code>copy/paste this.
> Now when you select cell E2 the number 234 will appear in that cell.
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "pawlingJohn" <(E-Mail Removed)> wrote in message
> news:F98C03C6-4B9E-42B1-B9F6-(E-Mail Removed)...
> > 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
> >> (E-Mail Removed)
> >> "pawlingJohn" <(E-Mail Removed)> wrote in message
> >> news:56E03EF1-994C-436F-91DD-(E-Mail Removed)...
> >> >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 With Quote
 
pawlingJohn
Guest
Posts: n/a
 
      15th Jan 2009
Opps!!! I have to put the X in quotes.

Thanks a millions Don.

"Don Guillett" wrote:

> Right click the sheet tab>view code>copy/paste this.
> Now when you select cell E2 the number 234 will appear in that cell.
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "pawlingJohn" <(E-Mail Removed)> wrote in message
> news:F98C03C6-4B9E-42B1-B9F6-(E-Mail Removed)...
> > 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
> >> (E-Mail Removed)
> >> "pawlingJohn" <(E-Mail Removed)> wrote in message
> >> news:56E03EF1-994C-436F-91DD-(E-Mail Removed)...
> >> >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 With Quote
 
Don Guillett
Guest
Posts: n/a
 
      15th Jan 2009
Glad you got it figured out.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"pawlingJohn" <(E-Mail Removed)> wrote in message
news:34982546-E02D-45A9-8A15-(E-Mail Removed)...
> Opps!!! I have to put the X in quotes.
>
> Thanks a millions Don.
>
> "Don Guillett" wrote:
>
>> Right click the sheet tab>view code>copy/paste this.
>> Now when you select cell E2 the number 234 will appear in that cell.
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> (E-Mail Removed)
>> "pawlingJohn" <(E-Mail Removed)> wrote in message
>> news:F98C03C6-4B9E-42B1-B9F6-(E-Mail Removed)...
>> > 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
>> >> (E-Mail Removed)
>> >> "pawlingJohn" <(E-Mail Removed)> wrote in message
>> >> news:56E03EF1-994C-436F-91DD-(E-Mail Removed)...
>> >> >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 With Quote
 
PawlingJohn
Guest
Posts: n/a
 
      26th Jan 2009
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
> (E-Mail Removed)
> "pawlingJohn" <(E-Mail Removed)> wrote in message
> news:34982546-E02D-45A9-8A15-(E-Mail Removed)...
> > Opps!!! I have to put the X in quotes.
> >
> > Thanks a millions Don.
> >
> > "Don Guillett" wrote:
> >
> >> Right click the sheet tab>view code>copy/paste this.
> >> Now when you select cell E2 the number 234 will appear in that cell.
> >>
> >> --
> >> Don Guillett
> >> Microsoft MVP Excel
> >> SalesAid Software
> >> (E-Mail Removed)
> >> "pawlingJohn" <(E-Mail Removed)> wrote in message
> >> news:F98C03C6-4B9E-42B1-B9F6-(E-Mail Removed)...
> >> > 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
> >> >> (E-Mail Removed)
> >> >> "pawlingJohn" <(E-Mail Removed)> wrote in message
> >> >> news:56E03EF1-994C-436F-91DD-(E-Mail Removed)...
> >> >> >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 With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      26th Jan 2009
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
<(E-Mail Removed)> 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
>> (E-Mail Removed)
>> "pawlingJohn" <(E-Mail Removed)> wrote in message
>> news:34982546-E02D-45A9-8A15-(E-Mail Removed)...
>> > Opps!!! I have to put the X in quotes.
>> >
>> > Thanks a millions Don.
>> >
>> > "Don Guillett" wrote:
>> >
>> >> Right click the sheet tab>view code>copy/paste this.
>> >> Now when you select cell E2 the number 234 will appear in that cell.
>> >>
>> >> --
>> >> Don Guillett
>> >> Microsoft MVP Excel
>> >> SalesAid Software
>> >> (E-Mail Removed)
>> >> "pawlingJohn" <(E-Mail Removed)> wrote in message
>> >> news:F98C03C6-4B9E-42B1-B9F6-(E-Mail Removed)...
>> >> > 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
>> >> >> (E-Mail Removed)
>> >> >> "pawlingJohn" <(E-Mail Removed)> wrote in message
>> >> >> news:56E03EF1-994C-436F-91DD-(E-Mail Removed)...
>> >> >> >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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
I type data into a cell that changes when I click enter - why? =?Utf-8?B?Y3J1aXNlcg==?= Microsoft Excel Misc 2 30th Mar 2007 12:49 AM
Default Button Click On Enter KeyPress On Web Form Joey Microsoft ASP .NET 1 28th Feb 2007 04:12 PM
Enter Text in Cell on Click Steven Drenker Microsoft Excel Programming 2 26th Jan 2006 09:21 PM
enter data in cell but cannot save until click off cell in excel =?Utf-8?B?VDcwTWNDYWlucw==?= Microsoft Excel Misc 1 18th Nov 2005 05:06 PM
WHY DO I HAVE TO CLICK ON THE CELL & ENTER FOR THE VLOOKUP TOWORK =?Utf-8?B?SGFsZiBNYW54?= Microsoft Excel Misc 4 29th Sep 2005 12:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:21 PM.