Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default when change value of cell

Hi,
can someone please help me?

I need to program this:

When I Change value in cell A1 from
"en" to "cz"
Implicit value is "en"
the Caption of Button1 change from
"English" to "Czech"
How to do it please?

Tom


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default when change value of cell

Hi Tom,

One way

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
With Target
If LCase(.Value) = "en" Then
Me.Shapes("Button 1").Select
Selection.Characters.Text = "English"
ElseIf LCase(.Value) = "cz" Then
Me.Shapes("Button 1").Select
Selection.Characters.Text = "Czech"
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

This is worksheet event code, so right-click the sheet tab, select View Code
from the menu, and paste it in.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"tpapaj " wrote in message
...
Hi,
can someone please help me?

I need to program this:

When I Change value in cell A1 from
"en" to "cz"
Implicit value is "en"
the Caption of Button1 change from
"English" to "Czech"
How to do it please?

Tom


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default when change value of cell

In Your project window go to ThisWorkbook. In the top of code window: Left dropdown choose Workbook, Right dropdown choose SheetChange then add this code

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) "this is generated for you

If Target.Address = "$A$1" The
Select Case UCase(Target
Case "CZ
ActiveSheet.OLEObjects("Button1").Object.Caption = "Cz
Case "EN
ActiveSheet.OLEObjects("Button1").Object.Caption = "En
End Selec
End I

End Sub "this is generated for you


----- tpapaj wrote: ----

Hi
can someone please help me

I need to program this

When I Change value in cell A1 from
"en" to "cz
Implicit value is "en
the Caption of Button1 change fro
"English" to "Czech
How to do it please

To


--
Message posted from http://www.ExcelForum.com


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default when change value of cell

I think these are forms buttons judging by the button name.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"chris" wrote in message
...
In Your project window go to ThisWorkbook. In the top of code window: Left

dropdown choose Workbook, Right dropdown choose SheetChange then add this
code:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As

Range) "this is generated for you"


If Target.Address = "$A$1" Then
Select Case UCase(Target)
Case "CZ"
ActiveSheet.OLEObjects("Button1").Object.Caption = "Cz"
Case "EN"
ActiveSheet.OLEObjects("Button1").Object.Caption = "En"
End Select
End If

End Sub "this is generated for you"



----- tpapaj wrote: -----

Hi,
can someone please help me?

I need to program this:

When I Change value in cell A1 from
"en" to "cz"
Implicit value is "en"
the Caption of Button1 change from
"English" to "Czech"
How to do it please?

Tom


---
Message posted from http://www.ExcelForum.com/




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
change cell contents when pull down menu choices change jb21 Excel Worksheet Functions 3 November 21st 08 10:34 PM
making copied cells change with change in original cell Jennifer Mcdermeit Excel Worksheet Functions 2 July 20th 06 04:58 PM
change background row color with change of date in a cell Urszula Excel Discussion (Misc queries) 5 May 17th 06 07:56 AM
How do I change a number in one cell to change a series of cells? lance559 Excel Discussion (Misc queries) 2 January 13th 06 08:56 PM
Change workbook sheet reference using cell A1 to change a vairable Reed Excel Worksheet Functions 4 January 20th 05 07:15 PM


All times are GMT +1. The time now is 10:12 AM.

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"