LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel button problem


I left out two periods in the With Statement. I'm not sure why the
sheet name didn't get changed. I also missed the fact that the MOVE
method was creating a new workbook.




VBA Code:
--------------------


Sub mba()
Dim nme As Name

Application.ScreenUpdating = False
Application.EnableEvents = False

With Sheets("MBA")
.Range("MBAData").Copy
.Range("A80").PasteSpecial _
Paste:=xlValues
End With

Sheets("MBA").Copy After:=Sheets(Sheets.Count)
Set NewSht = Sheets(Sheets.Count)
With NewSht
.Name = "Client MBA"
.Range ("A1")
.Cells.Copy
.cellsPasteSpecial _
Paste:=xlValues
End With

Range("MBApaste").Clear
Sheets("MBA").Visible = False

Sheets("Client MBA").Move
Set NewBk = Activeworkbook

For Each nme In NewBk.Names 'delete named ranges not needed in new
'Workbook
If nme.Name Like "*_FilterDatabase" Or _
nme.Name Like "*Print_Area" Or _
nme.Name Like "*Print_Titles" Or _
nme.Name Like "*wvu.*" Or _
nme.Name Like "*wrn.*" Or _
nme.Name Like "*!Criteria" Then
Else
nme.Delete
End If
Next nme
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub

--------------------


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=187201

http://www.thecodecage.com/forumz/chat.php

 
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
excel email pdf button problem nicholas v Excel Discussion (Misc queries) 2 October 5th 09 09:44 PM
problem with drop down button in excel karthik New Users to Excel 1 May 14th 08 04:48 PM
Excel VBA User Form - button problem weakissues Excel Programming 1 June 13th 04 05:12 PM
Excel Add-in problem; button changes add-in path John Mason Excel Programming 0 May 20th 04 04:22 AM
Excel VBA - Excel crashes when macro button re-assigned problem PaulC Excel Programming 6 April 17th 04 08:57 PM


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