If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Hiding Excecution From User

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-13-04, 11:24
Alexxx12 Alexxx12 is offline
Registered User
 
Join Date: Sep 2002
Location: NJ
Posts: 139
Hiding Excecution From User

HI,

win xp
excel 2k

Is there a way to run this code from sheet1 without seeing anything happening? the changes is long. In another word, I don't want the user to see what takes place in sheet1.

Code:
Private Sub CommandButton1_Click()
    sheet2.activate
    Dim FNAME, LNAME As String
    FNAME = InputBox("OLD NAME? :", "Name to change", "THERESA")
    LNAME = InputBox("NEW NAME? :", "Name to change", "PAMELA")
    Dim MyCells As Range
        
        For Each MyCells In Range("A1:BX356")
                'MyCells.Select
                If MyCells = FNAME Then
                MyCells.Value = LNAME
            End If
        Next
sheet1.activate
End Sub
Reply With Quote
  #2 (permalink)  
Old 09-13-04, 15:22
ray705 ray705 is offline
Registered User
 
Join Date: Feb 2003
Location: Wichita,KS
Posts: 44
Turn off the screen updating as follows.
Code:
Private Sub CommandButton1_Click()
    sheet2.activate
    Dim FNAME, LNAME As String
    FNAME = InputBox("OLD NAME? :", "Name to change", "THERESA")
    LNAME = InputBox("NEW NAME? :", "Name to change", "PAMELA")
    Dim MyCells As Range
        
Application.ScreenUpdating = False
        For Each MyCells In Range("A1:BX356")
                'MyCells.Select
                If MyCells = FNAME Then
                MyCells.Value = LNAME
            End If
        Next
sheet1.activate
Application.ScreenUpdating = True
End Sub
Reply With Quote
  #3 (permalink)  
Old 09-13-04, 15:22
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Add the line asfter Dim statements:
Code:
Application.ScreenUpdating = False
Then after sheet1.Activate add this line:

Code:
Application.ScreenUpdating = True
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #4 (permalink)  
Old 09-13-04, 15:23
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Ray, you are too fast for my old hands! LOL
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On