Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default change text in FormatButton

Hi all,
Below I have tried to modify a code to work in my application, but as you
can see, I'm not so succesful.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim btn As Button
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B9:B18")) Is Nothing _
And Target.Value < "" Then
For Each btn In Me.Buttons
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing Then
btn.Caption = Target
If Not Intersect(Target, Range("c9:c18")) Is Nothing _
And Target.Value < "" Then
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing Then
btn.Caption = Target
Exit For
End If
Next
End If

End Sub


This is what I want to do:
In a separate sheet I set the values in cells E9:E109. Then return that
value to a cell in the same sheet as I have the buttons.
I have 100 buttons in 10x10 area (cell B9:K18 gets the value from
E9:E109)The value should return under the button and then be displayed in
the button. Maybe it's possible to return the value directly from the other
sheet and cells E9:E109.?

Hope someone can help me with this one

//Thomas


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default change text in FormatButton

Provide the requested information and corrections and perhaps someone can
help.

--
Regards,
Tom Ogilvy

"Jonsson" wrote in message
...
Hi all,
Below I have tried to modify a code to work in my application, but as you
can see, I'm not so succesful.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim btn As Button
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B9:B18")) Is Nothing _
And Target.Value < "" Then
For Each btn In Me.Buttons
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing Then
btn.Caption = Target
If Not Intersect(Target, Range("c9:c18")) Is Nothing _
And Target.Value < "" Then
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing Then
btn.Caption = Target
Exit For
End If
Next
End If

End Sub


This is what I want to do:
In a separate sheet I set the values in cells E9:E109. Then return that
value to a cell in the same sheet as I have the buttons.
I have 100 buttons in 10x10 area (cell B9:K18 gets the value from
E9:E109)The value should return under the button and then be displayed in
the button. Maybe it's possible to return the value directly from the

other
sheet and cells E9:E109.?

Hope someone can help me with this one

//Thomas




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default change text in FormatButton

Hi Tom
I'ts already done in the post " Tom Ogilvy again"
You had many questions and I tried to answer them the best I could, inspite
of my poor english.

Thomas

"Tom Ogilvy" skrev i meddelandet
...
Provide the requested information and corrections and perhaps someone can
help.

--
Regards,
Tom Ogilvy

"Jonsson" wrote in message
...
Hi all,
Below I have tried to modify a code to work in my application, but as

you
can see, I'm not so succesful.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim btn As Button
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B9:B18")) Is Nothing _
And Target.Value < "" Then
For Each btn In Me.Buttons
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing

Then
btn.Caption = Target
If Not Intersect(Target, Range("c9:c18")) Is Nothing _
And Target.Value < "" Then
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing

Then
btn.Caption = Target
Exit For
End If
Next
End If

End Sub


This is what I want to do:
In a separate sheet I set the values in cells E9:E109. Then return that
value to a cell in the same sheet as I have the buttons.
I have 100 buttons in 10x10 area (cell B9:K18 gets the value from
E9:E109)The value should return under the button and then be displayed

in
the button. Maybe it's possible to return the value directly from the

other
sheet and cells E9:E109.?

Hope someone can help me with this one

//Thomas






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default change text in FormatButton

In Sheet2 (sheet with the buttons), right click on the sheet tab and select
view code. Put in this code:

Private Sub Worksheet_Calculate()
Dim btn As Button
For Each btn In Me.Buttons
If btn.TopLeftCell.Text < "" Then
btn.Caption = btn.TopLeftCell.Value
End If
Next
End Sub


--
Regards,
Tom Ogilvy

"Jonsson" wrote in message
...
Hi Tom
I'ts already done in the post " Tom Ogilvy again"
You had many questions and I tried to answer them the best I could,

inspite
of my poor english.

Thomas

"Tom Ogilvy" skrev i meddelandet
...
Provide the requested information and corrections and perhaps someone

can
help.

--
Regards,
Tom Ogilvy

"Jonsson" wrote in message
...
Hi all,
Below I have tried to modify a code to work in my application, but as

you
can see, I'm not so succesful.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim btn As Button
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B9:B18")) Is Nothing _
And Target.Value < "" Then
For Each btn In Me.Buttons
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing

Then
btn.Caption = Target
If Not Intersect(Target, Range("c9:c18")) Is Nothing _
And Target.Value < "" Then
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing

Then
btn.Caption = Target
Exit For
End If
Next
End If

End Sub


This is what I want to do:
In a separate sheet I set the values in cells E9:E109. Then return

that
value to a cell in the same sheet as I have the buttons.
I have 100 buttons in 10x10 area (cell B9:K18 gets the value from
E9:E109)The value should return under the button and then be displayed

in
the button. Maybe it's possible to return the value directly from the

other
sheet and cells E9:E109.?

Hope someone can help me with this one

//Thomas








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default change text in FormatButton

Tom!
Just what I needed
You are great!!

Thank you

//Thomas

"Tom Ogilvy" skrev i meddelandet
...
In Sheet2 (sheet with the buttons), right click on the sheet tab and

select
view code. Put in this code:

Private Sub Worksheet_Calculate()
Dim btn As Button
For Each btn In Me.Buttons
If btn.TopLeftCell.Text < "" Then
btn.Caption = btn.TopLeftCell.Value
End If
Next
End Sub


--
Regards,
Tom Ogilvy

"Jonsson" wrote in message
...
Hi Tom
I'ts already done in the post " Tom Ogilvy again"
You had many questions and I tried to answer them the best I could,

inspite
of my poor english.

Thomas

"Tom Ogilvy" skrev i meddelandet
...
Provide the requested information and corrections and perhaps someone

can
help.

--
Regards,
Tom Ogilvy

"Jonsson" wrote in message
...
Hi all,
Below I have tried to modify a code to work in my application, but

as
you
can see, I'm not so succesful.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim btn As Button
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("B9:B18")) Is Nothing _
And Target.Value < "" Then
For Each btn In Me.Buttons
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is

Nothing
Then
btn.Caption = Target
If Not Intersect(Target, Range("c9:c18")) Is Nothing _
And Target.Value < "" Then
If Not Intersect(btn.TopLeftCell.Offset(0, 0), Target) Is Nothing

Then
btn.Caption = Target
Exit For
End If
Next
End If

End Sub


This is what I want to do:
In a separate sheet I set the values in cells E9:E109. Then return

that
value to a cell in the same sheet as I have the buttons.
I have 100 buttons in 10x10 area (cell B9:K18 gets the value from
E9:E109)The value should return under the button and then be

displayed
in
the button. Maybe it's possible to return the value directly from

the
other
sheet and cells E9:E109.?

Hope someone can help me with this one

//Thomas












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
Can Text Function change output text color? epiekarc Excel Discussion (Misc queries) 1 December 31st 08 02:58 AM
change the text in the legend of a chart w/o changing pivot text msp Charts and Charting in Excel 2 December 17th 08 08:53 PM
How can I change text to proper text in multiple cells. bethye99 Excel Discussion (Misc queries) 1 January 10th 06 06:17 PM
Change of text or background color doesn't change on the screen. Susan Excel Discussion (Misc queries) 5 July 29th 05 07:18 PM
HOW TO CHANGE BAHTTEXT (THAI TEXT) TO ENGLISH TEXT IN EXCEL BASHIR Excel Worksheet Functions 0 March 29th 05 12:49 PM


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