LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hiding the sheets my macro works with...

It is entirely possible to work with the contents of sheet 2 withou
EVER activating or selecting it.

you can use pieces of code such as "Pick2 = Sheet2.Cells(x, 1).Value"

Try replacing ALL of what you posted with ALL of the following:


Code
-------------------

Pick = ComboBox1.Value

x = 1
'by using the x variable to specify the row,
'you can make the While-Loop begin at B1
'automatically, without selecting it

While Sheet2.Cells(x, 2) < Pick
x = x + 1
' TODO: Move the cursor over to the LEFT once
Wend

'the cell in column B which is finally found to
'contain the value of Pick will be Sheet2.Cells(x,2)
'with x being whatever it is when the while-loop ends

Pick2 = Sheet2.Cells(x, 1).Value


Sheet1.Select
Sheet1.Range("G5").Select
ActiveCell.Value = Pick2

-------------------



If you replace your first posted version with the new version above
you should still get the result you are looking for.

I am about 99% confident with the replacement that I am posting. I a
no 100% sure because I don't have a clear vision of EVERYTHING you ar
doing with your entire program. That is, I assume that these ten t
twenty lines of code are but a small part of your overall project. S
I would have to know more about the whole thing in order to "guarantee
what I'm proposing.

Nonetheless...

try it!

I think you'll like it

(by the way, you could formulate a similar "fix" in order to enter
value into G5 of sheet 1 without selecting that sheet either.

--
Message posted from http://www.ExcelForum.com

 
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
function works on some sheets but not others danafeldman Excel Worksheet Functions 4 October 13th 08 07:30 PM
Hiding and Showing Sheets using Macro engbe Excel Discussion (Misc queries) 3 May 12th 08 05:14 AM
hiding zero values on all sheets & by default on new sheets WiFiMike2006 Excel Worksheet Functions 4 January 19th 07 08:13 PM
Locking Sheets / Hiding Sheets Lee Harris Excel Worksheet Functions 4 November 29th 05 07:21 AM
Hiding sheets with macro disabled - with a big twist! Tim[_36_] Excel Programming 1 April 23rd 04 08:21 AM


All times are GMT +1. The time now is 03:03 AM.

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"