ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Named sheet to change Cells names (https://www.excelbanter.com/new-users-excel/153731-named-sheet-change-cells-names.html)

Skrapik

Named sheet to change Cells names
 
Situation is really tricky for me, (D;E) 4 in one peace, and i need it to be
named as my sheet but not fully, Sheet name is T 060_esik (and "esik" part
needs transport into cell D;E4) is it possible?

I guess i explained correctly! Thnx

Gary''s Student

Named sheet to change Cells names
 
Let's assume that your sheetname hastwo parts separated by an underscore.
The following UDF will return the part following that undersco

Function sname(r As Range)
Application.Volatile
sname = Split(r.Parent.Name, "_")(1)
End Function

So if the sheetname is qwerty_asdf
=sname(A1)
will display:
asdf
--
Gary''s Student - gsnu200736


"Skrapik" wrote:

Situation is really tricky for me, (D;E) 4 in one peace, and i need it to be
named as my sheet but not fully, Sheet name is T 060_esik (and "esik" part
needs transport into cell D;E4) is it possible?

I guess i explained correctly! Thnx


Skrapik

Named sheet to change Cells names
 
DAMn... sorry but i dont get it.. is that macro? And whats UDF =)

Function sname(r As Range)
Application.Volatile
sname = Split(r.Parent.Name, "_")(1)
End Function

Where should i add this?


"Gary''s Student" wrote:

Let's assume that your sheetname hastwo parts separated by an underscore.
The following UDF will return the part following that undersco

Function sname(r As Range)
Application.Volatile
sname = Split(r.Parent.Name, "_")(1)
End Function

So if the sheetname is qwerty_asdf
=sname(A1)
will display:
asdf
--
Gary''s Student - gsnu200736


"Skrapik" wrote:

Situation is really tricky for me, (D;E) 4 in one peace, and i need it to be
named as my sheet but not fully, Sheet name is T 060_esik (and "esik" part
needs transport into cell D;E4) is it possible?

I guess i explained correctly! Thnx


Max

Named sheet to change Cells names
 
"Skrapik" wrote:
DAMn... sorry but i dont get it.. is that macro? And whats UDF =)


Think UDF = User Defined Function

To implement GS' UDF, try these steps:

Copy the UDF from GS' post
Press Alt+F11 to go to VBE
Click Insert Module
Right-click paste into the code window (the empty space on the right)

Press Alt+Q to get back to Excel

In Excel, in a sheet named as, say: My_Gosh
place in say B1: =sname(A1)
B1 will return: Gosh

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com