Save & Return To Last Location

Jun 9, 2006

User selects 'go to page B' on page A. They look at an object then click the object to go back to page A. Once back on page A they need to check data on page B, but in the same general location as where they just looked. This is over simplified, but pretty much sums up what I need to do. The code I have now is below, but keeps sending me to the last selection on my current page.

Public Sub SaveLocation(ReturnToLoc As Boolean)
Static WB As Workbook
Static WS As Worksheet
Static R As Range
If ReturnToLoc = False Then
Set WB = ActiveWorkbook
Set WS = ActiveSheet
Set R = Selection
Else
WB.Activate
WS.Activate
R.Select
End If
End Sub

Public Sub SetSaveLoc()
SaveLocation (False)
End Sub

Public Sub GetSaveLoc()
SaveLocation (True)
End Sub

View 2 Replies


ADVERTISEMENT

Allow Save As With Different Location But NOT Name

Aug 26, 2006

I have the following code allowing the user to save a file using a custom macro button. However, I do not want to let them change the name of the file, just the location. How do I do this? ...

View 9 Replies View Related

Set Autorecover Save Location In VBA

Feb 2, 2010

I have a macro which performs the auto save function perfectly. I'm looking at possible enhancements.

1. How to set autorecover save location in VBA? I know how to do this on the front-end i.e goto tools/options/save tab and set it there As i have disabled save autorecovery feature, autorecover save location is greyed out

2. How to create a backup of my workbook? So that my workbook will perform autosave and when i close this workbook at the end of the day all the latest changes are added to the backup and saved

View 2 Replies View Related

Save To Specific Location As Cell Name

Oct 14, 2009

I've been searching for ages trying to work out how to do this but have so far only managed to confuse myself. i have office 2007 and I have found some code to convert an excel sheet to PDF, however I need it to saveas the contents of cell (e6) and save to a location on our network drives (C:TEMP).

View 2 Replies View Related

Automatically Save As PDF But Include Location

Sep 13, 2012

I have a workbook with 4 worksheets the first is called "input" which I use to enter information which goes to the other worksheets which arecalled engine, gearbox, doors.

I am stuck on the following; after inputting the information. I want to save as pdfs in various locations.

Is it possible to have 4 buttons on the input sheet which automatically :

Button 1 - Save "engine" worksheet as a pdf to a specified folder
Button 2 - Save "gearbox" worksheet as a pdf to a specified folder
Button 1 - Save "doors" worksheet as a pdf to a specified folder
Button 1 - Save the sheets as multiple excel files to a specified folder

View 4 Replies View Related

Save Location As String Or Range?

Aug 22, 2013

I often need to save the user's current position on a worksheet, do some stuff then get them back to where they started. In the past I've saved the current location sometimes as a string and sometimes as a range.

Code:
Sub BackToRange()
Dim BackToHere As Range
Set BackToHere = Selection
' do stuff
BackToHere.Select
End Sub

Code:
Sub BackToString()
Dim BackToHere As String
BackToHere = Selection.Address
' do stuff
Range(BackToHere).Select
End Sub

View 5 Replies View Related

Trusted Location - How To Save To And Access

Sep 29, 2008

managed to get a piece of code working to create unique sequential numbers for purchase orders, but only by "enabling all macros" which is apparently not recommended and could conceivably, as I understand it, leave a PC vunerable to viriuses contained in other imported files.

Please bear with me as I'm very new to anything other than basic Excel functions; macros were, until last week, something I didn't even know existed, let alone how to use them. Anyway, having got my macro working, I understand that the best thing to do is put it in a "trusted location" from where it will work automatically without requiring operator input (whilst still maintaining high overall security), rather than "enabling all macros", but I have a couple of issues with this.

Firstly, having created a folder in "my documents" as per the instructions, how do I save the macro there? What format should it be in? Surely not a word document? (as you can gather I am still really in the dark about all this). If not, what?

Secondly, how do I direct Excel to access and run the macro from this "trusted location" folder, rather than the already existing "module1"?

View 9 Replies View Related

VBA PDF Code Alteration To Allow Specific Save Location?

Aug 23, 2012

I am running a macro in Excel which automatically generates a PDF of my worksheet. Currently it saves in the default location but i want to modify it to a specific location - P:Emergency Services|Procative ContactForms PDF.

The current code is;

VB:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("E7").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Range("A1:E43").Select

View 5 Replies View Related

Image Picture Resize And Save As On Different Location?

Aug 21, 2014

I have a picture on my image at userform. And I want to change my picture size ( like attached picture: fast image resizer program ) and save as different location. It is my school project.

Your valuable macro codes about ıf this and attached workbooks are very important for me.

View 3 Replies View Related

Macro To Prompt For Save Location And Filename

Feb 22, 2014

In a workbook, I use a macro to extract a sheet and save it as xls.

What code should I use to prompt the user to define the location and name of the new file to be saved?

View 1 Replies View Related

Save As File Type To Parent Location

Apr 21, 2006

I've been searching all morning through various posts on this subject, but I can't find anything that I can adapt to my needs. Here is the code I have:

ChDir "C:Documents and SettingsmynameDesktop"
ActiveWorkbook. SaveAs Filename:= _
"C:Documents and SettingsmynameDesktopBook1.txt", FileFormat:=xlText, _
CreateBackup:=False

This file will be used accross multiple computers and therefore the directory will always change. What I need to hapen, is for this code to save the workbook in the same directory as the origional file. I also want the file name to refer to a cells value, as I will be having the user define the name through a userform.

View 4 Replies View Related

Save File Under Current Name In A Selected Location

May 4, 2006

I get an xl file sent to me every day which I upload into a database. I then save the file keeping its name and save it into a selected folder. Is it possible to add a macro at the beginning of my current macro that saves the file using its name to a selected folder?

View 4 Replies View Related

Hyperlinks Won't Work When Save File To Another Location On Computer

Jan 8, 2014

I've created a spreadsheet of clients and info; I want each client name to link to their specific folder on my computer for easy referencing. I entered in all the links and they work just fine; however, when i tried to save the file to another location on my computer so it could be used by another employee (same terminal, etc, just in another folder) the hyperlinks stopped working.

View 5 Replies View Related

Save As Macro With Location Prompt But Fixed File Name ?

Dec 29, 2008

For a sheet that many non-expert users will use on different systems I need a macro that let's them save, print and send the results of their work. So I made a macro that makes a copy of only 1 sheet of the workbook and saves it with a given name to a given location. The problem is that I want a location prompt to ask the user where they want the file saved, while giving/suggesting them a fixed filename. A lot of different users will make and use their sheets so I need a certain naming policy to manage all the files. (date, location, etc)

View 4 Replies View Related

Excel 2010 :: Save Open File Location?

Nov 26, 2012

I just got a new computer and upgraded to Excel 2010 and Windows 7. When I try to open a workbook in Excel 2010, my saved file paths on the left side of the screen are gone. I want to put them back in there.

In Excel 2007 running Windows XP, I would just right click in the left side menu and click "add" and now that's no longer an option.

View 1 Replies View Related

Save Workbook To A Specific Location - 1004 Error?

Jul 21, 2013

Im struggling to get a workbook to a specific location. I have copied 3 worksheets to a new workbook, which im trying to save to an archive folder. Here is my code.

Code:
Sub atest()
Dim strFileName As String
Dim Archivepath As String

[Code]....

The problem is i keep getting an error (runtime 1004) saying the file could not be found?? well, im trying to create it !..

View 2 Replies View Related

Save Excel Sheet To A Specific Location Through Macro

Nov 19, 2009

I have a excel sheet which is completely formula driven and no macros in that.

I want to macro which can save that excel sheet to a specific location.

View 9 Replies View Related

VBA Macro To Follow Hyperlinks & Save Files To Another Location

Jan 16, 2010

I am attempting to write an Excel macro that will be stored in a file called MacroFile. The purpose of the macro is to

1. Follow a hyperlink to an Excel file saved in a SharePoint type enviroment
2. Save the file to my laptop directory My Documents.

Below is the code I have written. The code is following the hyperlink and saving a file but is the focus file is incorrect.

Here is what happens:

1. Open up MacroFile and run macro
2. Hyperlinked file LinkedFile_1.xls is opened
3. File NewFile_1 is saved but contains the info from MacroFile
4. Hyperlinked file LinkedFile_2.xls is opened
5. File NewFile_2 is saved but contains the info from LinkedFile_1
6. Hyperlinked file LinkedFile_3.xls is opened
7. File NewFile_3 is saved but contains the info from LinkedFile_2

The files created are named correctly but have the wrong data in them. I need to know how to control which file is considered ActiveWorkbook.

Sub LinkAndCopy()
Application. ScreenUpdating = False
Application.DisplayAlerts = False
'**** Copy LinkedFile_1..................

View 2 Replies View Related

VBA Create New Folder In Current Location And Save Selected Sheets As PDF

Feb 2, 2014

I have the below code that saves selected sheets of my workbook as pdfs in the current file location. What I would like this code to be able to do is to create a new folder (named with todays date), and then save each of the pdfs into this folder.

Code:
Sub SaveWorksheetsAsPDFs()
Dim sFile As String
Dim sPath As String
Dim fPath As String
Dim wks As Worksheet

[Code] ........

View 3 Replies View Related

Macro To Save Worksheets As Workbooks- Name And Location To Change Each Month

May 30, 2008

I have a workbook with approximately 30 worksheets. This workbook already has a massive macro that I've written. I'd like to write a code that will take a designated worksheet, check to see if there is data in cell A2, if so, save it as a new workbook.

The name of the workbook should be predetermined, for example "SIA April(Previous Month) 2008(Current Year) P-Card Import Template.xls"
The months and years will need to change.

The file to save it in will also change monthly- for example- G:PCard DirectoryCloses2008 ClosesApril(previous month) 2008(current year)

View 9 Replies View Related

VbA Code To Automatically Put Date Filename And Default Save Location

Aug 11, 2008

I have a spreadsheet that from a button I want to run a macro that will input todays date, the value in cell A1 as the filename into a default dialog box that is at a default file path. I have been trying to do this for several hours and can not completely get it done.

View 9 Replies View Related

Return To Last Location

Jul 6, 2007

How do I write a VB Script to take the user back to where they came from.

Example:

User is on Sheet 1 and clicks a macro that takes him to Sheet 10.
I need a macro that is on Sheet 10 that takes the user back to Sheet 1.
BUT if the User is on Sheet 5 and clicks on a macro that take him to Sheet 10
I need that same macro on Sheet 10 to take him back to Sheet 5.

View 14 Replies View Related

Open Multiple Files, Check Current Month & Save To New Location

Sep 15, 2007

I have 40 files in one folder which I named it as "CA" + month's name that I am working on. I need to do analyse these files monthly and save it under new folder. how do I automatically save them in new folder and name them for that particular month. Also, each file has worksheet which has one cell as "Aug-07" and the cell next to it has number of that month that is "08". How do I automatically change this also based on the name of the file, because file name month and month in the cell are the same.

View 9 Replies View Related

Return Cursor To Last (previous) Location

Dec 30, 2008

I am familiar with the codes suggested here: http://www.eggheadcafe.com/software/...-previous.aspx

I move the cursor with Hyper-Links or just by clicking another cell.

I wonder - is there something I can add/do in order to enable returning from ANOTHER sheet !?

View 10 Replies View Related

Return Active Cell's Location/row

Apr 9, 2009

I'm having trouble identifing a way to return a location for the position of the active cell. I've searched Excel help with "Position, location, return, activecell, etc." and I can't seem to figure this out. I know that it's possible, so that's why I'm on here!

...

Ok, say the active cell is currently "F1", and I need the location "F1" to identify the ROW to be used in a formula later, how would I go about that?

The current contents of cell "F1"' will be "REPLACE", but I need to change the words "REPLACE" in "F1" and other cells labeled "REPLACE" in column F to the following formula (where the "1" in "A1" is is the current row):

View 9 Replies View Related

Search One Column For The Location Of That Value And Return The Row Value

May 8, 2008

I have a value stored in variable A. I need to search one column for the location of that value and return the row value. there is no chance for a duplicate entry. Is a loop my only option, or is there a find command in VB?

View 9 Replies View Related

Return Cell Location: Of Several Items

Aug 27, 2008

I would like to return the cell location of names in column A as they are located in columns B and C, and return the locations in column D....

View 9 Replies View Related

Find Address And Return GPS Location From Another Sheet

Jun 3, 2014

I have a table with customers and their addresses (sheet2) and I need to find their GPS locations in sheet1.

I guess the logic would need to be something like this:

find CityName and StreetName in sheet1 where StreetNo is between minStreetNo and maxStreetNo return GPS X and GPS Y

with the formula or VBA code?

Example.xlsx

View 2 Replies View Related

Excel 2007 :: Search Box Function - Return Value / Text Not Location

May 15, 2014

I need code for a search box function, that returns the information recorded in a cell for example, "Barcelona" or "London" etc), instead of the location of the cells.

I will need to narrow it down to search only the information in the following columns:

Sheet2
I2:J10932

I am totally new to VBA coding and have stumbled my way through a few things, but everything I have searched for so far has had at least one error when transposing to Excel.

I am running Excel 2007.

View 3 Replies View Related

Interpolation Given A Variable Table Location & Location Of Data Within

Oct 6, 2009

I am trying to develop a spreadsheet that will calculate a cost based on a matrix. I am attaching a sample of the calculation created so far. The end result is in cell M13 and is highlighted in yellow. I kind of layed the formula out in a few different cells, so hopefully it would be easy to follow.

simplify this process with maybe another formula that I might not be aware of, or maybe show me how to get this done in VB code. I think VB code would be the correct way to go just not sure.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved