#1   Report Post  
Steved
 
Posts: n/a
Default First Sheet

Hello From Steved

I've would like to know please, can the below macro
be change so that no matter what I name Sheet1 it will
return to sheet1, as an example I'm working in sheet 12.


Sub Test ()
Sheets (" Special Kilometres").Select
Range ("A2").Select
End Sub

Thanks in advance.
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Sub Test ()
Sheet1.Select
Range ("A2").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in message
...
Hello From Steved

I've would like to know please, can the below macro
be change so that no matter what I name Sheet1 it will
return to sheet1, as an example I'm working in sheet 12.


Sub Test ()
Sheets (" Special Kilometres").Select
Range ("A2").Select
End Sub

Thanks in advance.



  #3   Report Post  
Steved
 
Posts: n/a
Default

Thankyou very much.
-----Original Message-----
Sub Test ()
Sheet1.Select
Range ("A2").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in

message
...
Hello From Steved

I've would like to know please, can the below macro
be change so that no matter what I name Sheet1 it will
return to sheet1, as an example I'm working in sheet 12.


Sub Test ()
Sheets (" Special Kilometres").Select
Range ("A2").Select
End Sub

Thanks in advance.



.

  #4   Report Post  
Steved
 
Posts: n/a
Default

Hello From Steved

I've renamed Sheet1 to Otara Service
Why will the below macro not goto Sheet1

Sub SaveNClose()
Range("B5").Select
Sheet1.Select
Range("B5").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub

Thankyou.
-----Original Message-----
Sub Test ()
Sheet1.Select
Range ("A2").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in

message
...
Hello From Steved

I've would like to know please, can the below macro
be change so that no matter what I name Sheet1 it will
return to sheet1, as an example I'm working in sheet 12.


Sub Test ()
Sheets (" Special Kilometres").Select
Range ("A2").Select
End Sub

Thanks in advance.



.

  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

Should work okay.

Go into the VBE, and for that workbook, look in the Project Explorer. You
should see an item Sheet1(Otara Service). If not, what do you see alongside
Otara Service? That is what you should use instead of Sheet1.Select.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in message
...
Hello From Steved

I've renamed Sheet1 to Otara Service
Why will the below macro not goto Sheet1

Sub SaveNClose()
Range("B5").Select
Sheet1.Select
Range("B5").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub

Thankyou.
-----Original Message-----
Sub Test ()
Sheet1.Select
Range ("A2").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in

message
...
Hello From Steved

I've would like to know please, can the below macro
be change so that no matter what I name Sheet1 it will
return to sheet1, as an example I'm working in sheet 12.


Sub Test ()
Sheets (" Special Kilometres").Select
Range ("A2").Select
End Sub

Thanks in advance.



.





  #6   Report Post  
Steved
 
Posts: n/a
Default

Hello from Steved

I see the problem Sheet3(Otara Service).
I've now inserted a Worksheet and now reads Sheet1(Otara
Service).

Thankyou.

So to recap I've over several files, so as long as it has
Sheet1(NAME) I can use 1 macro to execute the lot.

Thankyou


-----Original Message-----
Should work okay.

Go into the VBE, and for that workbook, look in the

Project Explorer. You
should see an item Sheet1(Otara Service). If not, what do

you see alongside
Otara Service? That is what you should use instead of

Sheet1.Select.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in

message
...
Hello From Steved

I've renamed Sheet1 to Otara Service
Why will the below macro not goto Sheet1

Sub SaveNClose()
Range("B5").Select
Sheet1.Select
Range("B5").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub

Thankyou.
-----Original Message-----
Sub Test ()
Sheet1.Select
Range ("A2").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing

direct)


"Steved" wrote in

message
...
Hello From Steved

I've would like to know please, can the below macro
be change so that no matter what I name Sheet1 it

will
return to sheet1, as an example I'm working in sheet

12.


Sub Test ()
Sheets (" Special Kilometres").Select
Range ("A2").Select
End Sub

Thanks in advance.


.



.

  #7   Report Post  
Bob Phillips
 
Posts: n/a
Default

Yes, because you are referencing the codename of the sheet, and that does
not change when someone renames the sheet. All workbook sheets will have a
codename and an Excel name.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in message
...
Hello from Steved

I see the problem Sheet3(Otara Service).
I've now inserted a Worksheet and now reads Sheet1(Otara
Service).

Thankyou.

So to recap I've over several files, so as long as it has
Sheet1(NAME) I can use 1 macro to execute the lot.

Thankyou


-----Original Message-----
Should work okay.

Go into the VBE, and for that workbook, look in the

Project Explorer. You
should see an item Sheet1(Otara Service). If not, what do

you see alongside
Otara Service? That is what you should use instead of

Sheet1.Select.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in

message
...
Hello From Steved

I've renamed Sheet1 to Otara Service
Why will the below macro not goto Sheet1

Sub SaveNClose()
Range("B5").Select
Sheet1.Select
Range("B5").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub

Thankyou.
-----Original Message-----
Sub Test ()
Sheet1.Select
Range ("A2").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing

direct)


"Steved" wrote in
message
...
Hello From Steved

I've would like to know please, can the below macro
be change so that no matter what I name Sheet1 it

will
return to sheet1, as an example I'm working in sheet

12.


Sub Test ()
Sheets (" Special Kilometres").Select
Range ("A2").Select
End Sub

Thanks in advance.


.



.



  #8   Report Post  
Steved
 
Posts: n/a
Default

Thankyou.

-----Original Message-----
Yes, because you are referencing the codename of the

sheet, and that does
not change when someone renames the sheet. All workbook

sheets will have a
codename and an Excel name.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steved" wrote in

message
...
Hello from Steved

I see the problem Sheet3(Otara Service).
I've now inserted a Worksheet and now reads Sheet1(Otara
Service).

Thankyou.

So to recap I've over several files, so as long as it

has
Sheet1(NAME) I can use 1 macro to execute the lot.

Thankyou


-----Original Message-----
Should work okay.

Go into the VBE, and for that workbook, look in the

Project Explorer. You
should see an item Sheet1(Otara Service). If not, what

do
you see alongside
Otara Service? That is what you should use instead of

Sheet1.Select.

--

HTH

RP
(remove nothere from the email address if mailing

direct)


"Steved" wrote in

message
...
Hello From Steved

I've renamed Sheet1 to Otara Service
Why will the below macro not goto Sheet1

Sub SaveNClose()
Range("B5").Select
Sheet1.Select
Range("B5").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub

Thankyou.
-----Original Message-----
Sub Test ()
Sheet1.Select
Range ("A2").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing

direct)


"Steved"

wrote in
message
...
Hello From Steved

I've would like to know please, can the below

macro
be change so that no matter what I name Sheet1 it

will
return to sheet1, as an example I'm working in

sheet
12.


Sub Test ()
Sheets (" Special Kilometres").Select
Range ("A2").Select
End Sub

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
make an excel worksheet (sheet 2) open w/ the cursor located in t. animated text in excel worksheet Excel Discussion (Misc queries) 0 February 10th 05 10:29 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM
linking multiple sheets to a summary sheet greg g Excel Discussion (Misc queries) 1 December 16th 04 07:43 AM
Function to automatically insert a new sheet as a result of data entry? Mark Mulik Excel Worksheet Functions 2 November 28th 04 02:21 AM
Naming & renaming a sheet tab Cgbilliar Excel Worksheet Functions 1 November 7th 04 05:57 PM


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