Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default Use a formula to populate a label from a textbox

I am tryin to caption a label from this textbox with no luck

Label1.Caption = (Round(TextBox1 / 0.03125, 0) * 0.03125)


the the label has to be formated like this
# ??/??

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Use a formula to populate a label from a textbox

maybe:

Label1.Caption _
= Application.Text(Round(textbox1.value / 0.03125, 0) * 0.03125, "# ??/??")


damorrison wrote:

I am tryin to caption a label from this textbox with no luck

Label1.Caption = (Round(TextBox1 / 0.03125, 0) * 0.03125)

the the label has to be formated like this
# ??/??


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default Use a formula to populate a label from a textbox

Hi Dave,
I am getting a type mismatch error

Label1.Caption _
= Application.Text(Round(textbox1.value / 0.03125, 0) * 0.03125, "#
??/??")

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Use a formula to populate a label from a textbox

I'm betting that what you have in textbox1 isn't a number (or doesn't look like
a number).

if isnumeric(textbox1.value) then
Label1.Caption _
= Application.Text(Round(textbox1.value / 0.03125, 0) * 0.03125, "# ??/??")
else
Label1.Caption = "not a number in textbox1"
end if



damorrison wrote:

Hi Dave,
I am getting a type mismatch error

Label1.Caption _
= Application.Text(Round(textbox1.value / 0.03125, 0) * 0.03125, "#
??/??")


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default Use a formula to populate a label from a textbox

Thanks dave,
Yes the problem was,
as soon as I hit the decimal the type mismatch error kicked in thanks
alot



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default Use a formula to populate a label from a textbox


When entering into the textbox,
is it possible to enter as fractions and decimals, when I enter as
fractions it becomes a non-number

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
Using Option Button to populate formula Archgrad Excel Discussion (Misc queries) 0 August 8th 06 10:47 PM
Help! Formula that can Ref. hidden data & Populate Cells with desired text [email protected] Excel Worksheet Functions 1 April 8th 06 06:12 AM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Data Label Value in Formula? Phil Hageman Charts and Charting in Excel 2 December 30th 04 05:07 PM
Formula looks like a label swedbera Excel Worksheet Functions 3 November 10th 04 06:44 PM


All times are GMT +1. The time now is 07:28 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"