Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Input box display

I'm using an input box to gather a condition for a macro. I found out
that I could click in a cell containing the needed data as well as
typing in the input box. When I click on a cell the input box displays
the cell reference rather than the cell content. Is there a way to
have the input box display the content, for example 1/27/2011, rather
than the reference =$E$238, for example?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Input box display

Slim Slender presented the following explanation :
I'm using an input box to gather a condition for a macro. I found out
that I could click in a cell containing the needed data as well as
typing in the input box. When I click on a cell the input box displays
the cell reference rather than the cell content. Is there a way to
have the input box display the content, for example 1/27/2011, rather
than the reference =$E$238, for example?


This suggests you're using Excel's InputBox method rather than VBA's
InputBox function. In this case, selecting cells is possible because
the control is actually a refedit and so will return the selection
address. That said, to get the cell contents you can use the address in
the normal fashion:

sMyVal = Application.InputBox... '//get cell reference
sMyVal = Range(sMyVal).Value '//replace with contents

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Input box display

I should have said the var sMyVal should be declared as Variant type.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
Input cell should display a percentage of input value in the cell Sherees Excel Discussion (Misc queries) 0 December 16th 09 10:25 PM
Input and display help... millwalll Excel Programming 2 November 29th 07 09:28 PM
Cell display after input swiftcode Excel Discussion (Misc queries) 4 September 20th 07 11:12 AM
How do I input 2525 to display 25.25 Ferdy Excel Discussion (Misc queries) 1 March 4th 07 03:46 PM
How to display an input onto excel? Alex Excel Programming 2 April 25th 05 03:53 AM


All times are GMT +1. The time now is 09:46 PM.

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

About Us

"It's about Microsoft Excel"