Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 84
Default Moving Worksheets using VB

Hi
I have the following code (created by setting up a macro):
Sheets.Add
ActiveSheet.Select
ActiveSheet.Move After:=Sheets(4)
ActiveSheet.Select
ActiveSheet.Name = "Feb Daily"
But I would like the Activesheet.move to always move the selected tab to the
'end' as when I run this macro I don't know how many worksheets I will have.
Is there any code that will tell it to do that?
Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Moving Worksheets using VB

try this

Sub movesheet()
ActiveSheet.Move _
After:=ActiveWorkbook.Sheets(ActiveWorkbook.Sheets .Count)
End Sub


"Marie Bayes" wrote:

Hi
I have the following code (created by setting up a macro):
Sheets.Add
ActiveSheet.Select
ActiveSheet.Move After:=Sheets(4)
ActiveSheet.Select
ActiveSheet.Name = "Feb Daily"
But I would like the Activesheet.move to always move the selected tab to the
'end' as when I run this macro I don't know how many worksheets I will have.
Is there any code that will tell it to do that?
Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Moving Worksheets using VB

Sub movesheet()
ActiveSheet.Move _
After:=ActiveWorkbook.Sheets(ActiveWorkbook.Sheets .Count)
End Sub

"Marie Bayes" wrote:

Hi
I have the following code (created by setting up a macro):
Sheets.Add
ActiveSheet.Select
ActiveSheet.Move After:=Sheets(4)
ActiveSheet.Select
ActiveSheet.Name = "Feb Daily"
But I would like the Activesheet.move to always move the selected tab to the
'end' as when I run this macro I don't know how many worksheets I will have.
Is there any code that will tell it to do that?
Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 84
Default Moving Worksheets using VB

Perfect, thanks.

"Mike" wrote:

Sub movesheet()
ActiveSheet.Move _
After:=ActiveWorkbook.Sheets(ActiveWorkbook.Sheets .Count)
End Sub

"Marie Bayes" wrote:

Hi
I have the following code (created by setting up a macro):
Sheets.Add
ActiveSheet.Select
ActiveSheet.Move After:=Sheets(4)
ActiveSheet.Select
ActiveSheet.Name = "Feb Daily"
But I would like the Activesheet.move to always move the selected tab to the
'end' as when I run this macro I don't know how many worksheets I will have.
Is there any code that will tell it to do that?
Thanks in advance.

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
Moving between worksheets Damon Excel Discussion (Misc queries) 3 July 7th 06 05:31 PM
Moving all worksheets jerredjohnson Excel Discussion (Misc queries) 1 June 15th 06 06:01 PM
Moving Between Worksheets Using Same Cell Address T Renner Excel Discussion (Misc queries) 4 June 2nd 06 07:50 PM
Problem saving the file after moving worksheets into another SteveD62226 Excel Discussion (Misc queries) 0 November 18th 05 11:01 PM
Arrow keys scroll worksheets L R Up Dn instead of moving the curso Benn-at-Bax Excel Discussion (Misc queries) 1 April 12th 05 08:36 PM


All times are GMT +1. The time now is 09:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"