+ Reply to Thread
Results 1 to 3 of 3

Automatically Select Range Before Saving

Hybrid View

2funny4words Automatically Select Range... 03-17-2010, 12:14 AM
excelxx Re: Automatically go to Range... 03-17-2010, 05:39 AM
2funny4words Re: Automatically go to Range... 03-18-2010, 07:18 PM
  1. #1
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    Automatically Select Range Before Saving

    As you can see from the code below, I am copying my report and pasting to a new workbook then saving the new workbook with a predetermined name.

    Private Sub cmdSaveReport_Click()
    Application.ScreenUpdating = False
    ActiveSheet.Select
    ActiveSheet.Copy
    ThisFile = Range("FileName").Value
    ActiveSheet.SaveAs Filename:="\\upstairs\shareddocs\Incident Reports\2010 Incident Reports\" & ThisFile & ".xls"
    Application.ScreenUpdating = True
    ActiveWorkbook.Close
    End Sub
    The problem that I am encountering is that when I open the newly saved form, I am always at the bottom of the form. I would like to open the saved form and be in Range h7:ac7 automatically. It is not a big issue as I have been using it this way for around a year but it would be a nice addition. Also as the form will never need to be updated, how do I get the newly saved form to not want to be updated every time I open it up?

    Thanks in advance
    Keith
    Last edited by 2funny4words; 03-18-2010 at 07:18 PM.

  2. #2
    Forum Contributor
    Join Date
    02-04-2010
    Location
    Hertfordshire, England
    MS-Off Ver
    Office 2007 (home) Office 365 (work)
    Posts
    134

    Re: Automatically go to Range H7:AC7 Before saving

    Hi

    I think the code you need is below.


    Sub cmdSaveReport_Click()
    Application.ScreenUpdating = False
    ActiveSheet.Select
    ActiveSheet.Copy
    ActiveWindow.ScrollRow = 7
    ActiveSheet.Range("H7").Activate
    ThisFile = Range("FileName").Value
    ActiveSheet.SaveAs Filename:="\\upstairs\shareddocs\Incident Reports\2010 Incident Reports\" & ThisFile & ".xls"
    Application.ScreenUpdating = True
    ActiveWorkbook.Close
    End Sub

  3. #3
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    Re: Automatically go to Range H7:AC7 Before saving

    It worked very well

    Thanks very much. I really appreciate all that have helped me here on this forum. Maybe someday I will be able to help someone else.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1