Solved

Scoring

Posted on 2013-06-17
11
178 Views
Last Modified: 2013-06-18
Hi Expert,

Need help to create VBA Code.

Step 1 Clicking Explore Button on sheet LT which search for LT.Z Sheet in workbook.
Step 2 If there, then End
Step 3 If Not there than create one - name LT.Z i.e. create copy of sheet Sample rename it to LT.Z

See attached File

Thanks
Z-Score.xlsm
Capture.PNG
0
Comment
Question by:itjockey
  • 7
  • 4
11 Comments
 
LVL 16

Expert Comment

by:terencino
ID: 39252701
Hi your XLSM sheet is protected. But the procedure is something like this:

Sub CheckLTZ()
Dim s as Worksheet
For Each s In ThisWorkbook.Sheets
If s.Name = "LT.Z" Then Exit Sub
Next s
Worksheets("Sample").Copy ThisWorkbook.Sheets(Sheets.Count)
ActiveSheet.Name = "LT.Z"
End Sub

Open in new window


...Terry
0
 
LVL 8

Author Comment

by:itjockey
ID: 39252712
Sorry "ee"
0
 
LVL 8

Author Comment

by:itjockey
ID: 39252715
Not That way if sheet name TT then Search for TT.Z if not found than create copy of sheet sample & rename to TT.Z

Thanks
0
 
LVL 16

Expert Comment

by:terencino
ID: 39252817
TT.Z, LT.Z, just change the code to suit. Have a look at the spreadsheet attached and press the Explore button to see what it does
Sub Explore()
Dim s As Worksheet
For Each s In ThisWorkbook.Sheets
If s.Name = "TT.Z" Then Exit Sub
Next s
Worksheets("Sample").Copy ThisWorkbook.Sheets(Sheets.Count)
ActiveSheet.Name = "TT.Z"
End Sub

Open in new window

Copy-of-Z-Score-1.xlsm
0
 
LVL 8

Author Comment

by:itjockey
ID: 39252865
working at once but if change Sheet Name to ACC then it wont create ACC.Z
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 16

Expert Comment

by:terencino
ID: 39252892
OK I think I got it, try this one instead
Copy-of-Z-Score-2.xlsm
0
 
LVL 8

Author Comment

by:itjockey
ID: 39252934
Yes up to the mark one more thing, if you can hide the sheet after creating... will be most use full for me.. after this I ll close this question.


Thank You
0
 
LVL 16

Accepted Solution

by:
terencino earned 500 total points
ID: 39253067
No problems, just added
ActiveSheet.Visible = xlHidden

Open in new window

Copy-of-Z-Score-3.xlsm
0
 
LVL 8

Author Comment

by:itjockey
ID: 39253704
Mr.terencino,
I am on way back to home as and when I reach my place I will accept your answer as I can not run this code in phone.this is very 1st step of my whole project if you wish to solve more on this pls be with me, As per my understanding who start from scratch will know my next question much better than other.i will post my next question link in this question,if you wish to solve most welcome,if don't want - No hard feeling.

Thank You
0
 
LVL 8

Author Closing Comment

by:itjockey
ID: 39254174
Thank You Very Much
0
 
LVL 8

Author Comment

by:itjockey
ID: 39255794
Need one more thing if my sample sheet is hidden then code will perform same.

My next question link which next procedure for same file.

Scoring V 2

Thank You
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now