Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi all,
my problem is to know how can i activate the last tab of an excel file in my code i am openning several excel files one by one (not at the same time) in my code and need to activate the last tab of each of them when the file is open i am usung the code below which i found in MS Excel help but it doesn't work everyone help me please. ActiveWindow.ScrollWorkbookTabs Position:=xlLast thanks, -- Farhad Hodjat |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Once you have opened a workbook, it becomes the Active workbook. So:
Sub lastone() Sheets(Sheets.Count).Activate End Sub should work just fine -- Gary''s Student - gsnu200821 "Farhad" wrote: Hi all, my problem is to know how can i activate the last tab of an excel file in my code i am openning several excel files one by one (not at the same time) in my code and need to activate the last tab of each of them when the file is open i am usung the code below which i found in MS Excel help but it doesn't work everyone help me please. ActiveWindow.ScrollWorkbookTabs Position:=xlLast thanks, -- Farhad Hodjat |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Gary! it worked great
-- Farhad Hodjat "Gary''s Student" wrote: Once you have opened a workbook, it becomes the Active workbook. So: Sub lastone() Sheets(Sheets.Count).Activate End Sub should work just fine -- Gary''s Student - gsnu200821 "Farhad" wrote: Hi all, my problem is to know how can i activate the last tab of an excel file in my code i am openning several excel files one by one (not at the same time) in my code and need to activate the last tab of each of them when the file is open i am usung the code below which i found in MS Excel help but it doesn't work everyone help me please. ActiveWindow.ScrollWorkbookTabs Position:=xlLast thanks, -- Farhad Hodjat |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you for the feedback!
-- Gary''s Student - gsnu200821 "Farhad" wrote: Thanks Gary! it worked great -- Farhad Hodjat "Gary''s Student" wrote: Once you have opened a workbook, it becomes the Active workbook. So: Sub lastone() Sheets(Sheets.Count).Activate End Sub should work just fine -- Gary''s Student - gsnu200821 "Farhad" wrote: Hi all, my problem is to know how can i activate the last tab of an excel file in my code i am openning several excel files one by one (not at the same time) in my code and need to activate the last tab of each of them when the file is open i am usung the code below which i found in MS Excel help but it doesn't work everyone help me please. ActiveWindow.ScrollWorkbookTabs Position:=xlLast thanks, -- Farhad Hodjat |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You're Welcome! i have another question how can i check a tab in a excel file
say tab "aaa" if it is exist in the file or not? sorry bugging you again i am very new in VBA and need to learn. Thanks, -- Farhad Hodjat "Gary''s Student" wrote: Thank you for the feedback! -- Gary''s Student - gsnu200821 "Farhad" wrote: Thanks Gary! it worked great -- Farhad Hodjat "Gary''s Student" wrote: Once you have opened a workbook, it becomes the Active workbook. So: Sub lastone() Sheets(Sheets.Count).Activate End Sub should work just fine -- Gary''s Student - gsnu200821 "Farhad" wrote: Hi all, my problem is to know how can i activate the last tab of an excel file in my code i am openning several excel files one by one (not at the same time) in my code and need to activate the last tab of each of them when the file is open i am usung the code below which i found in MS Excel help but it doesn't work everyone help me please. ActiveWindow.ScrollWorkbookTabs Position:=xlLast thanks, -- Farhad Hodjat |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Function SheetExists(SheetName As String) As Boolean
On Error Resume Next SheetExists = CBool(Len(ThisWorkbook.Worksheets(SheetName).Name) ) End Function so =sheetexists("aaa") will return True if the sheets exists. -- Gary''s Student - gsnu200821 "Farhad" wrote: You're Welcome! i have another question how can i check a tab in a excel file say tab "aaa" if it is exist in the file or not? sorry bugging you again i am very new in VBA and need to learn. Thanks, -- Farhad Hodjat "Gary''s Student" wrote: Thank you for the feedback! -- Gary''s Student - gsnu200821 "Farhad" wrote: Thanks Gary! it worked great -- Farhad Hodjat "Gary''s Student" wrote: Once you have opened a workbook, it becomes the Active workbook. So: Sub lastone() Sheets(Sheets.Count).Activate End Sub should work just fine -- Gary''s Student - gsnu200821 "Farhad" wrote: Hi all, my problem is to know how can i activate the last tab of an excel file in my code i am openning several excel files one by one (not at the same time) in my code and need to activate the last tab of each of them when the file is open i am usung the code below which i found in MS Excel help but it doesn't work everyone help me please. ActiveWindow.ScrollWorkbookTabs Position:=xlLast thanks, -- Farhad Hodjat |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() You can use this: Code: -------------------- Sheets(Sheets.Count).Select -------------------- you can use Activate rahther than Select if you wish! -- Simon Lloyd Regards, Simon Lloyd 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=43199 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro issue | Excel Discussion (Misc queries) | |||
MS Excel Macro issue | Excel Discussion (Misc queries) | |||
Macro issue | Excel Discussion (Misc queries) | |||
Macro Issue | New Users to Excel | |||
Easy macro issue (I think) | Excel Discussion (Misc queries) |