Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Worksheet Tabe Name
In MS EXCEL, I am pulling in some records from Access Database. using Import External Data feature. I am looking for a particular country and importing the data. The First Column contains the country. Is there anyway, the SHEET NAME to get renamed automatically by looking at Country name in Cell A1. If the country name is €śSingapore€ť, the worksheet tab should get changed to Singapore. When I import data next time into the same sheet for €śJapan€ť, the worksheet tab should change to €śJAPAN€ť automatically. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target Me.Name = .Value End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Ananth" wrote in message ... Worksheet Tabe Name In MS EXCEL, I am pulling in some records from Access Database. using Import External Data feature. I am looking for a particular country and importing the data. The First Column contains the country. Is there anyway, the SHEET NAME to get renamed automatically by looking at Country name in Cell A1. If the country name is "Singapore", the worksheet tab should get changed to Singapore. When I import data next time into the same sheet for "Japan", the worksheet tab should change to "JAPAN" automatically. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks very much. It worked.
"Bob Phillips" wrote: Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "A1" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target Me.Name = .Value End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Ananth" wrote in message ... Worksheet Tabe Name In MS EXCEL, I am pulling in some records from Access Database. using Import External Data feature. I am looking for a particular country and importing the data. The First Column contains the country. Is there anyway, the SHEET NAME to get renamed automatically by looking at Country name in Cell A1. If the country name is "Singapore", the worksheet tab should get changed to Singapore. When I import data next time into the same sheet for "Japan", the worksheet tab should change to "JAPAN" automatically. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search one worksheet for values in another worksheet? | Excel Discussion (Misc queries) | |||
Worksheet not showing up in VBE | Excel Worksheet Functions | |||
Inserting Filtered RC cell information into other worksheets | Excel Discussion (Misc queries) | |||
Search/Match between 2 x separate Worksheets and populate result in third worksheet | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions |