Create A Border Macro When Open The File

Jul 26, 2009

I have recorded a macro which will create the border for me when the file is opened, but it turned out too long. if someone can show me how to reduce the codeing. I have the attached file.

Range A5 to E20 thin Border all sides and thick border allround (16 rows)
Range A21 to E36 thin border all sides and thick border allround (16 rows)

end range is A356.

View 5 Replies


ADVERTISEMENT

Macro -open The Look In List” And Stop So I Can Pick A File To Open

Oct 18, 2008

I want to create a macro that will “open the look in list” and stop so I can pick a file to open. I’ve tried to use “record a macro” and “ctrl-o”, but the record a macro won’t stop until I pick a file or cancel the file list. I also tried to use “o” in the short cut key box

View 5 Replies View Related

How To Create Userform In Excel To Open Particular File Location

May 22, 2013

I am working on a project where i am having 8 excel files saved at diffrent location so i want to create userform which will open particular file location and from that user can select the file which he want and then can go further. so i need a coding so that user will be prompt 8 times with file location. for eg. once user select particular file from location then again this code route him to select next file from file location. is it possible??

I tried using below code but in this code when i run userform file is not opening but when i run this code mannually by pressing F8 desired file is opening i dont know what is glitch in this ? another problem i am facing is not able to understand how to repeat this steps again to open another file using this code??

VB:
Private Sub Commandbutton1_Click()
Dim f As FileDialog
Set f = Application.FileDialog(msoFileDialogFilePicker)
With f

[Code]....

View 4 Replies View Related

Macro To Open File Saved In Same Location But File Name Changes With Each Date

Feb 8, 2013

I do routine tasks every day which involves opening 3 different files and pasting data into my main file. The data is always in the same format, and the 3 files are saved in the same location (3 different folders through). The 3 files are saved each day and the naming convention is constant, with only the date changing. For example, the files are always saved in C:My Documents and the files are called test_05.02.2013.xls. Tomorrow the file will be called test_06.02.2013.xls and so on.

So each day I will be rolling a file forward and I want to bring in the info from each of these files based on the new day.

How to do 1, and I will do the others (because the concept will be the same).

View 1 Replies View Related

Open File Macro, Error - Incrementing File Name

Feb 2, 2007

When it opens the desired file, it increments the file name by 1 each time it is opened (via the macro).

Example;
The first time it is opened you see the file name in the header read "P'Binder L&T Pages" for a moment, then it changes to "P'Binder L&T Pages1"...
I close the file and open it again (via the macro), and see the file name in the header read "P'Binder L&T Pages" for a moment, then it changes to "P'Binder L&T Pages2"...
The file name continues to increment on every opening until the PC is rebooted, then it starts at 1 again.

Sub OpnLTpages()

Dim wb As Workbook
Dim AlreadyOpen As Boolean

AlreadyOpen = False

For Each wb In Workbooks 'Scan open workbooks
If wb.Name = "P'Binder L&T Pages.xls" Then ........................

View 9 Replies View Related

Create A Simple Macro To Open A Second Workbook?

Jan 31, 2014

I am trying to create a simple macro to open a second workbook if the value in a cell in the current workbook is 'x' or if 'y' do nothing.

Basically I have a simple sales ledger, one column has a yes/no for whether or not an invoice is paid if no I want to open a second workbook 'debtors' so that I can manually input the details. I'm sure this is a very simple proceedure but I can't seem to crack it.

View 2 Replies View Related

Copy Range In Another Sheet And Create Border

Feb 14, 2009

to copy column C and D, from row 3 to the end, from sheet2,in sheet1, column A and B, starting with row 2 and after that I need to create a border to the copied values and I need to create a border to the empty cell from column C.

open attached file

View 14 Replies View Related

VBA Code To Create Border Around Used Cells In Worksheet

Nov 20, 2013

I'm writing/recording a macro and would like some VBA code. I'm trying to make a border around all used cells in my sheet. When I use the macro there will be a variable number of used cells.

I'd like code that says:

If cell A2 has text then format cells A2:CL2 with an outline border Repeat for each row in the sheet until there there is no more text in column A.

Also, not sure if it matters, but I'm working on a mac.

View 9 Replies View Related

Excel 2003 :: Macro To Open Folder Then User Selects File Then Macro Continues To Run

Nov 6, 2011

I use Excel 2003 at work. I'm looking for some code that will Open a folder and then lets the user to select a file then continues to run the macro.

The file name they select will look similar to this K2271011.504 or K3011111.201

View 3 Replies View Related

Open File Macro: Same Directory As Macro Workbook

Nov 17, 2006

I created folder on my desktop to hold various documents. I have master excel document which contains forms and command buttons that open documents from same folder. Is there a way to change code instead of having full file path to specify current directory. I'm worried that if I move this folder to another location then my open file button will not work since location is changed.

Also when I open with command button word document, I have a button on word document to close. I can close document but word application is still active. Can I close word application with the document at the sam time. This is the code I'm using: "ActiveWindow.Close"

View 3 Replies View Related

Open File With Macro

Dec 29, 2007

I was wondering what the code is to open a file (already specified in macro) when you run a macro

View 3 Replies View Related

Macro Needs To Run Each Time I Open The File

Oct 21, 2008

I need a Macro to run when a file is opened through a macro on another workbook. The code I have for the workbook that open's the file is:

PHP
Sub opensaveclose()
    Application.Workbooks.Open ("C:...testfile_revised.xls")
    Sheets("Call Report").Select
End Sub

Private Sub runmacro()
    Application.Run ("RefreshStats")
End Sub 

View 6 Replies View Related

Autostart Macro When Open The File

Mar 12, 2009

how to produce an autostart macro, so when i open the excel file it will go straight to a specific worksheet, or is there another easier way of doing this ?

View 2 Replies View Related

Macro That Will Open The File Path

Dec 10, 2008

hi, i need a macro that will open the below file path, and when i select the file i would like the macro to copy the active sheet from the source file being opened from range A2:L10000 and then paste special values to destination CELL A16 of the activesheet of the workbook.

I would like the date format for the below to be generic so it will apply for all months and years.

S:RECSBANKRECNominees200812-2008

View 9 Replies View Related

Open A Pdf File In Macro Code

Aug 11, 2004

how to open a pdf file (located: "C:myfile.pdf") in macro code?

View 4 Replies View Related

Macro: Check If File Open

Dec 19, 2006

I have a form in Access with a button that opens an Excel file. I think I've seen vba code to tell if a specific Excel file is open already. What I'm looking for is a way to tell if an Excel file is already open when you don't know the filename of the Excel file. Is that possible? Or at the very least is there a way to be able to tell if Excel is already open?

View 4 Replies View Related

File Open Dialogue Box To Open In (Directory Of Tool File)

May 31, 2013

I have a tool file which contains Excel VBA codes. When I click button it asks to select a file. I want that anytime I click the button the dialogue box should open in the folder containg the tool.,

View 1 Replies View Related

Macro To Close One Excel File And Open Another?

Jul 18, 2014

I have created several excel files as I cannot open them all at once since they are too large. So I have to open one excel file whilst closing another.

part1
part2
part3
part4
part5

I want a macro that opens the excel file part 1 and part 2. Then it should close part 1 and after closing part 1 it should open part 3. Once part 3 is open, part 2 should be closed and when part 2 is closed part 4 should open. When part 4 is open, then part 3 should be closed and part 5 should open.

View 1 Replies View Related

Error In Macro That Checks If The File Is Already Open

Mar 26, 2009

I thought that I had this working completely, but the test to see if the "file is already open" isn't working.

Something is wrong with my example.

I have marked in the code where the problem is. Everything else works. It's marked as such: ...

View 4 Replies View Related

How Do I Get A Certain Macro To Run Anytime I Open Any Excel File

Sep 3, 2009

I want to put in an if-then statement in a macro that will check to what kind of report i open so it will automatically know what to do with it. Where do I put that macro? I tried it in auto_open in my personal.xlsb file but it stops before the file actually opens.

View 9 Replies View Related

VBA Macro To Find Specific File & Open

Nov 16, 2008

I've got a VBA macro set up in one Master excel file that manipulates a number of other files. Both the Master and the other files are all in a folder which is currently called C:Documents and SettingsusernameDesktopPipeline and my VBA script has this defined as the filepath and works exactly as I need it to. I will be moving the folder "Pipeline" to a shared drive on my server so my staff can access it, and will be sending it to colleagues who will be installing it on their own servers so they and their staff can use it. Is there a way to amend the code so that the VBA in the Master file looks in the folder in which it is locate, "Pipeline", no matter what the filepath leading to the "Pipeline" folder is?

View 8 Replies View Related

Macro To Parse And Open Text File

Apr 2, 2007

1. Open a text file from a directory on my computer
2. Feed the data into a Excel spreadsheet
3. Parse the text from the text file into columns

an example of some of the stuff in the text file (its all fake btw )

192.168.1.216,,,
J2MARTIN,20/08/1999,8:57:27 a.m.,
372,http://www.microsoft.com/isapi/redir.dll?,,
192.168.1.216,,,
J2MARTIN,20/08/1999,8:57:27 a.m.,
326,http://home.microsoft.com/,,
192.168.1.216,,,
J2MARTIN,20/08/1999,8:57:29 a.m.,
37014,http://www.msn.com/default.asp?,,

Is it possible to feed all this data into excel into seperate rows and then start parsing it into columns of

IP Username Date Time KbUsage URL

View 2 Replies View Related

Excel 2010 :: Using Macro To Open Network File

Jan 5, 2014

I am an extreme novice to using macros.

I used the 'record macro' feature to create the following: I created a rectangle box on sheet1 of NEW TEST.xlsm to link to the macros incidated below. Niether macro moves on after reaching the Workbooks.Open statement.

I am at a loss. Is there something in Excel that needs to be set? Is there something else that I need to do version of Excel is 14.0.6129.5000 (32 bit) MS Office Professional Plus 2010

What I am trying to accomplish is this: From 'NEW TEST.xlsm', open an excel file on the network, add a new sheet to this network file, calling it 'Pivot'. Then create a pivot table in this new sheet from the data in sheet data1 of this same network file. Then move control of macro / processing back to the NEW TEST file. Eventually I will do more, but for starters, I cannot even get the macro to add / name a new sheet in the network file.

[SIZE=3][COLOR=#000000][FONT=Arial]PS I have attached the NEW TEST.xlsm fikle as we as the data file. NOTE: the data file has been reduced to one day's worth of data, to to the upload file size.Also, my Excel Trustred locations has "Allow trusted locations on my network" checked, and the network location to the data file in trusted user locations.

VB:

Sub Open_Add_Sheet()
Dim filename, filelocation As String
Dim wb As Workbook
filename = "11 Nov, 2013 GDO AHS Agent Productivity Report.xls"
filelocation = "R:acharukAHS ReportsGDOGDO CSR ACTIVITY Report2013" & filename
Set wb = Workbooks.Open(filelocation) '
' Open_Add_Sheet Macro

[Code]....

View 9 Replies View Related

Run Excel Macro From Batch File. Workbook Open

Feb 24, 2009

I wanted to run a batch file which does something like,

Dir /b >Test.csv
Start Test.csv

And then runs an Excel macro once the workbook is open.

I looked into this and discovered that it’s not really that possible to run an excel macro through batch file but other options were to use ‘Workbook_Open’ etc.

I thought this might cause problems because Test.csv doesn’t contain a macro to auto open and because csv’s usually don’t like macros.

I do however have personal.xlsb which opens every time if that helps.

View 6 Replies View Related

Excel 2007 :: Macro To Open File From A Folder

Oct 19, 2012

I just need a macro to open any excel file may be 2003, or 2007 from a folder.

I did tried Dir but not working. I want the macro in 2007.

View 4 Replies View Related

Edit Macro To Open Specific File Automatically

Aug 16, 2007

I am using this code to get me to a path then I click on the file I want and it opens it and makes it a .csv file. Then my code does stuff with it and closes it. My question is, do I even have to click on it? Can I get the macro to automatically open the file. Note the "NewestFolderInThePath" is a function that open me up to the "newest" created folder in the path. From there I double click file.

NewestFolderInThePath = ReturnNewestFolder("\datawhse
ootLAW81LAWSONprintRBLEVINS2anrvwfins1")
Path = "\datawhse
ootLAW81LAWSONprintRBLEVINS2anrvwfins1"

TheFile = Path & NewestFolderInThePath
CreateObject("WScript.Shell").CurrentDirectory = TheFile

TheFile = Application.GetOpenFilename("Excel Files (*.*), *.*", , "Open Balance Sheet File FRPMBSDTL")
If TheFile = "False" Then
continue = MsgBox("Do you want to Continue to IS Download?", _................

View 9 Replies View Related

MACRO Saveas Keeping Current File Open

Nov 13, 2008

I have the following Macro that I run assigned to a Button.

Sub AskAndDo()
If MsgBox("Have you Finished collecting data ?", vbYesNo + vbQuestion) = vbNo Then
Exit Sub
Else
If MsgBox("Have you Printed the Reports ?", vbYesNo + vbQuestion) = vbNo Then
Exit Sub
Else
ActiveWorkbook.SaveAs Filename:="\gamingntcompanyFLOAT MASTERFloat_Sheet_" & Format(Date, "_YY_MM_DD")
End If
End If
Application.Quit
End Sub.......

View 9 Replies View Related

Macro: Allow User To Choose Workbook/File To Open

Sep 8, 2006

I am making a macro that requires that user to enter a directory path into a input box and the macro will open the file. Right now it works fine bit i would like to change the code so that instead of using an input box it brings up a box that will allow them to browse files on their computer and then select one to open.

View 4 Replies View Related

Apply A Bottom Page Border In Excel File?

Nov 6, 2012

I want to apply a bottom page border in my excel file. The page border should be fixed, i.e. if you insert a row above the border then the border should not shift as well.

View 2 Replies View Related

How To Create Macro To Change Value In CSV File

Aug 21, 2012

I have a CSV file contain many fields and all fields have value (positive & negative values). I have 3 questions here:

1) This file is created on Friday. So the date in Field1 is Friday's date. I want to change the date to Saturday date. How can i change it using macro?
2) I want to set the value for fields 24 until 26 to 0. I want the script to force the field value to be 0. How can i do that by using macro?..and fyi, my CSV file have header in the first row. Below i illustrate my original csv file and the expected output.
3) How can i automate the macro to run every Friday afternoon?

Original csv
Field1, Field2,....,Field24, Field25, Field26, Field27
"20120803","ABC",...,9.032,24.52,-6.325,21.12
"20120803","ABC",...,5.242,-1.53,7.005,21.12

Expected output csv
Field1, Field2,....,Field24, Field25, Field26, Field27
"20120804","ABC",...,0,0,0,21.12
"20120804","ABC",...,0,0,0,21.12

View 1 Replies View Related







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