Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-10-2012, 05:39 AM
gbaker gbaker is offline Run Code when Workbook opens Windows 7 32bit Run Code when Workbook opens Office 2010 32bit
Competent Performer
Run Code when Workbook opens
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Run Code when Workbook opens

How do I set up code so that when my workbook opens is automatically runs it. I tried to put the code into ThisWorkbook but it doesn't work.
Thanks in advance for your help!!!
GWB



Code:
Sub pvalue()
'
' pvalue Macro
'
'
Workbooks(1).Activate

    Sheets("PRINT VIEWING CALENDAR").Select
    Sheets("PRINT data").Visible = True
    ActiveWindow.ScrollColumn = 4
    Columns("E:CA").Select
    Selection.Copy
    Sheets("PRINT VIEWING CALENDAR").Select
    Columns("E:CA").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("PRINT data").Select
    ActiveWindow.SelectedSheets.Visible = False
    ActiveWindow.ScrollRow = 52
    ActiveWindow.ScrollRow = 42
    ActiveWindow.ScrollRow = 32
    ActiveWindow.ScrollRow = 12
    ActiveWindow.ScrollRow = 2
    Range("D1").Select
End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word opens with 2 pgs jmacky Word 4 01-28-2013 09:10 AM
Run Code when Workbook opens #REF! error when opening a workbook that contain a refference to another workbook tanababa Excel 2 06-07-2012 03:11 PM
Range(Cell1,Cell2) Error on another workbook controlling some other workbook? tinfanide Excel Programming 1 02-09-2012 04:08 PM
Run Code when Workbook opens macro to transfer data from one workbook to another workbook virsojour Excel Programming 5 02-01-2011 08:58 PM
Run Code when Workbook opens Select a range in one one workbook while working in other workbook Slow&Steady Excel 1 02-21-2010 03:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft