Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 12th, 2005, 09:08 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default Move focus from Cell

I have a search form that I have put together in Excel. It uses 3 cells D6, D8 and D10. I then have a button that pulls the values from those cells and uses them to generate a list of results. The problem I am having is that if I am entering a value into a cell, I cannot click the button without first clicking else where on the page to close the edit. Does anyone have any suggestions for avoiding this? I have tried [D9].Selected in the code for the button, but the click event doesn't even appear to be firing.

Thanks in advance

Mike

Mike
EchoVue.com
__________________
Mike
EchoVue.com
Reply With Quote
  #2 (permalink)  
Old April 12th, 2005, 09:30 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Bournemouth, Dorset, United Kingdom.
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are the cells on this sheet (D6 D8 D10) the only cells to be entered?

If so can I suggest you the following functionality, (it will open a User Form when a user makes the current worksheet the active worksheet)...

1 create a user form blank template in the VBeditor
2 place 3 blank text boxes in the form
3 place a button in the form
4 edit the code by double clicking the button you just created
5 the syntax for the SUB commandbutton1_click() will be be generated automatically
6 write the following code
7 Sheets("sheetname").Range("d6").value = textbox1.value
  Sheets("sheetname").Range("d8").value = textbox2.value
  Sheets("sheetname").Range("d10").value = textbox3.value
  userform1.hide

The user can then tab from textbox to text box and close the form when completed.

If you are more resctricted by your dev requirements please say how.

Cheers

Matthew

Reply With Quote
  #3 (permalink)  
Old April 12th, 2005, 09:38 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Thanks!! I was looking for something like that a few weeks ago, but obviously didn't ask it right! I think that will work, let me try it and get back to you.

Thanks again

Mike

Mike
EchoVue.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't move focus to control <control scptech Access VBA 8 October 26th, 2007 12:16 PM
I need to refer a cell within a cell like =RC[ RC2 chakravarthi_os Excel VBA 1 September 24th, 2006 08:19 AM
Move focus to field without selecting text echovue Access VBA 1 April 12th, 2006 01:52 AM
if the cell content is a part of another cell cont sriramus Excel VBA 1 November 15th, 2005 10:20 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM



All times are GMT -4. The time now is 05:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.