Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to Rewrite these Code?


Dear All

Kindly look at the code below and advice me whether there's anothe
variation which I could use... Currently, the code works fine bu
because I am selecting and activiating the sheet... i am not able t
specify in my macro which sheet to go back to... For eg, I am at Sheet
and activating the macro from there... but after the macro ends, i wil
be brought to the Sheet2 which I don't want... I want the active shee
to be still Sheet1 after the macro has finished... So is there anothe
way of writing the same function but without actually activating th
sheet? I have tried this code but it didn't work...
Sheets("Sheet2").Range("k133:m144").Select
Does anyone have any clue...?

Function Own() As String
Sheets("Sheet2").Select
Range("K133:M144").Select
End Function

Cheer

--
hc
-----------------------------------------------------------------------
hce's Profile: http://www.excelforum.com/member.php...nfo&userid=351
View this thread: http://www.excelforum.com/showthread.php?threadid=26445

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to Rewrite these Code?

Hi HCE,

It is rarely necessary to make selections.

If you wanted to enter a specific value in the K133:M144", you could achieve
this, without making a selection, thus:

Sub Tester03()
Sheets("Sheet2").Range("K133:M144").Value = "ABC"
End Sub

In your code, you show no action except for the unwanted selection. If you
have a specfic requirement, pos details and someone will provide you will
try to help you further.

---
Regards,
Norman



"hce" wrote in message
...

Dear All

Kindly look at the code below and advice me whether there's another
variation which I could use... Currently, the code works fine but
because I am selecting and activiating the sheet... i am not able to
specify in my macro which sheet to go back to... For eg, I am at Sheet1
and activating the macro from there... but after the macro ends, i will
be brought to the Sheet2 which I don't want... I want the active sheet
to be still Sheet1 after the macro has finished... So is there another
way of writing the same function but without actually activating the
sheet? I have tried this code but it didn't work... -
Sheets("Sheet2").Range("k133:m144").Select
Does anyone have any clue...?

Function Own() As String
Sheets("Sheet2").Select
Range("K133:M144").Select
End Function

Cheers


--
hce
------------------------------------------------------------------------
hce's Profile:
http://www.excelforum.com/member.php...fo&userid=3518
View this thread: http://www.excelforum.com/showthread...hreadid=264458



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
rewrite code terilad Excel Discussion (Misc queries) 2 April 9th 10 09:42 AM
rewrite excell files on website Raymondo Excel Discussion (Misc queries) 1 October 28th 08 03:25 PM
Help with Macro Using InStrRev: How to Rewrite to Use on Macs and Wart Excel Discussion (Misc queries) 3 April 28th 08 08:49 PM
Rewrite name in new format ALaw Excel Discussion (Misc queries) 4 February 6th 08 04:52 PM
vlookup [rewrite] Janis Excel Discussion (Misc queries) 0 July 25th 07 10:36 PM


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