Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Moving Worksheets using VB
Sub movenameactivesheet)
With ActiveSheet .Name = "Don" .Move After:=Sheets(Sheets.Count) End With End Sub -- Don Guillett SalesAid Software "Marie Bayes" wrote in message ... 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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Moving between worksheets | Excel Discussion (Misc queries) | |||
Moving all worksheets | Excel Discussion (Misc queries) | |||
Moving Between Worksheets Using Same Cell Address | Excel Discussion (Misc queries) | |||
Problem saving the file after moving worksheets into another | Excel Discussion (Misc queries) | |||
Arrow keys scroll worksheets L R Up Dn instead of moving the curso | Excel Discussion (Misc queries) |