Working With Muliple Workbooks/xls Files

Jun 20, 2007

in simple terms im trying to cross reference a name list with registers from another wrokbook. so basically the desired result is. i press my button and it loads the second workbook up, it then uses the a name list in the new book and searches for that names maches in the registers (a group of sheets) on the previous workbook then if a match is found it colours the background in green. I am however getting errors e.g. "run time error: '424': Object required"

with this line then highlighted in yellow:
u = ShtNm.Sheets("Sheet1").Cells(1, "C").Value

Sub Macro1()
Dim u As Integer
Workbooks.Open FileName:= _
"S:HR TrainingO2 Operational TrainingRetentions and CollectionsUpgrades
ames 18th june onwards.xls"
ShtNm = ActiveWorkbook.Name...............

View 3 Replies


ADVERTISEMENT

Validate Texbox :: Value Entered Is A Muliple Of ...

Feb 7, 2009

Is it possible to validate a texbox at entry time to ensure the value entered is a muliple of 6.50.

i.e. ONLY 6.50 or 13 or 18.5 etc is entered. I have used the MOD command at spreadsheet level to accomplish this but have no idea if it's possible at userform / VBA level.

View 9 Replies View Related

Inserting A Muliple IF Statement In My Recorded Macro

Sep 21, 2009

I recorded a macro (which worked), then tried to get more out of it by adding code to add a further function (which didn't work). The code is as follows:-

View 3 Replies View Related

Working With Two Workbooks Through USERFORM?

Jul 29, 2014

i have 2 workBooks (firstWB & secondWB)

In fristWB i have UserForm in which their is
TextBox_1 & Transfer_btn-->cmdbutton
..with transfer_btn i want anything written in TextBox_1 should always paste new row in secondWB workbook
I am trying to do this with USERFORM

i am also trying to do DYNAMIC CHART in USER FORM

View 10 Replies View Related

Macro Not Working For Other Workbooks

Jan 28, 2014

Below is a code which I added to my 'Quick access toolbar' (and which is based off a hidden workbook). I use this macro to fulfill tasks to regular excel spreadsheets that are not macro enabled, however, I can't seem to get this macro to work for other workbooks. How to modify my code to work for other spreadsheets.

[Code] .....

View 4 Replies View Related

Working With Closed Workbooks

Dec 2, 2006

i can use application.username to get activeuser name and have excel check this and close the workbook if its not me, what i want to do is have excel check lets say cell A1 in workbook SECURITY.xls stored in C: and if it says Craig Shippey leave workbook open if not close the workbook, why i said working with closed workbooks is i dont want to have any indication on where its checking from,

1. i have a workbook in which i want an Workbook_open macro lets call this workbook staff.xls
2. the staff.xls should read cell A1 from C:security.xls into a variable called Check
3 if check craig shippey close workbook without any prompt

all this should be done without anyone knowing that a macro opens another workbook, i know if the user disables macros then it will still open, but i will just set their Macro Security level to low so they wont be prompted, i will also remove that item from their menu bar, if they cant see it they wont be able to alter it back

View 9 Replies View Related

Vba Copy Paste Between Workbooks Not Working

Jun 2, 2008

Why isn't my copy and paste working between workbooks? We use excel 2000. I've resorted to using a lot of selection because I can't seem to figure out what is going on otherwise...

I'm sure this should be much simpler...


Sub PortData()
Dim wbA As Workbook, wbB As Workbook
Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet, ws4 As Worksheet, ws5 As Worksheet, ws6 As Worksheet
Dim sPath As String, sName As String, bTextSwitch As Boolean
Dim nLast As Long
Dim i As Long

View 9 Replies View Related

Form Not Working If Other Workbooks Are Open

Mar 24, 2009

I've been developing a form in excel (not userforms, just the usual conditional formatting, validation and macros to show/hide rows etc). It all works fine now except one thing was noticed when a colleague was testing it. If she opens the form from the email, and she already has excel open, then the form will not work when she makes a selection from the dropdown list, which unhides the rest of the form. If she closes down all of excel and opens the form from fresh, it works fine.

View 9 Replies View Related

Running Stopwatch In Background While Working On Other Workbooks

Apr 14, 2014

I am trying to create a timekeeping workbook that will track the time I spend on certain tasks. I have created the attached worksheet including macros that correctly allows me switch between tasks but I cannot run this set of macros in one workbook and work in another.

AtTask Timer.xlsm

View 1 Replies View Related

Multiple Instances Of Excel When Working With Two Workbooks

Jan 31, 2012

Windows 7 . How do i open multiple instances of excel? even when im working with two workbooks rather than both appearing as the active book in excel only one can be on top. id ideally like to have both appear side by side on my desktop, vertically not horizontally.

View 1 Replies View Related

Using Text Files Vs Workbooks

Sep 3, 2006

What is the need for storing information in a text file instead of just keeping the data in excel on a worksheet or in vba code.

for example.

I have a file that was given to me that on the OpenWorkbook event runs through an "INI read " procedure. All this does in get certain data from a text file such as:

file paths, rates, file names

Is there any need for this as you could easily store the same information on a worksheet and declare variables in the code.

View 9 Replies View Related

Stop Working Out File Paths For Referenced Workbooks....?

Apr 29, 2009

I'm working on a sheet which references a sheet in another workbook. I want to refer to the other workbook simply by it's filename (Forecast.xls) but whenever I save and reopen Excel has replaced the filename with the full path (C:Documents and SettingskoconnorMy DocumentsAuto-sheet project[Forecast.xls])

This is quite inconvinient as I am eventually going to want to move both workbooks together to a different location. Is there a way to make Excel stop working out full file paths and just look for the filename in whichever folder the active sheet is sitting in?

View 3 Replies View Related

Compare Two Very Large Files - Vlookup Is Not Working?

Jul 24, 2014

I'm trying to compare two very large files to find some that are in one AND also in the other. I'm using =VLOOKUP(C2,Parts2!C:D,1,FALSE) and my results are #N/A for all of them. I have formatted both columns as 'General' because there can be letters and numbers in the serial number, I have also tried formatting as text to no avail. I have confirmed no preceding or trailing spaces or other special characters.

I am however, able to locate values in both documents using Ctrl F. I'm totally puzzled because I've always been able to figure out what's causing my Vlookup issues when I have them but this time I'm not able to.

View 14 Replies View Related

Links To CSV Files, Find And Replace Not Working

Apr 9, 2009

I have a large spreadsheet that has links to CSV files. Every month I need to create a new folder and put the CSV files into that folder, all the CSV files from month to month have the same name for each worksheet.

I'm trying to do Find and replace on the Folder name within the links to change say, February to March so I can just add the CSV files for each month and the spreadsheet will link to the new CSV file in the folder.

I have even tried adding all the February CSV's to the March folder so that when I overwrite the CSV's it will update the master spreadsheet, but it keeps asking me where to look for the folder.
Here is an example of a link:

='\FileservermsbilBRANCH REPORTSBM ReportsFebruary[TItemToDispense@40186 Export Dispensed Item Data-00.CSV]TItemToDispense@40186 Export Di'!BM2

As you can see the folder is named February within the link and I need to replace it with March.

View 9 Replies View Related

Compare Data From 3 Workbooks Against 2 Files

Feb 15, 2010

For the past several days I have been attempting to write a macro, which in theory would check the values within a one- sheet workbook (we’ll call it run_list.xls) against the values in two different workbooks (we’ll call these production.xls, development.xls). However after several days I am nowhere closer to solving this problem then I was when I started. I’ve tried different scripts and variations of vlookup, but I have been unsuccessful in tailoring what I have found to meet my needs. So I feel it is time to lie down and scream for a medic.

Here’s some background on the workbooks. The sheets in all three workbooks are set up in the same manner. Cell “A1” contains time/ date, cell “A2” contains a lot#, cells “A3:A99” contain positioning data, and cells “B3:B99” contain serial numbers associated with tubes in the specific positions. The only differences between the workbooks are the sheets in production.xls and development.xls are labeled according to their specific lot number.

What I have been trying to do is to take a value from cell "B3"in run_list.xls and find where that value occurs in column B either of workbooks. When that value was found I wanted to copy cell "A2" from its sheet and paste that value in cell "D3" of run_list.xls. I had also wanted to repeat that those steps for every cell in column B containing a serial #. If a serial number was not found I wanted it to report “Not Found”. There are also times when instead of a serial number a phrase “No Trakmate” is listed. In these cases I had intended to skip these lines.

Also, since production.xls, development.xls are updated frequently their names are also updated with new version numbers ie. Production_v10.xls I had intended to allow the user to choose what files to search in but was unable to figure out how to add a second location.

View 9 Replies View Related

Open Many Files/Workbooks & Run Macro

Oct 16, 2006

Here is what I'm doing:

-Open .xls file
-Run a macro (it works correctly when run by itself but I'm trying to speed things up)
-Save
-Close
-Open next file, and so on (I'll do this on no more than 200 files at a time all in the same folder)

Here is the code I am using: ....

View 9 Replies View Related

Links To Other Workbooks Breaking When The Files Are Replaced?

Jun 12, 2013

I have a master workbook (that I will call 'A') with a number of links to other workbooks ('B' to 'Z'). 'A' is designed to collate and display the data held in workbooks 'B' to 'Z'. The links all work fine until the 'B' to 'Z' workbooks are updated with new data, at which point, the links break with a "Error: source not found" error.

This is caused by the process by which we update the 'B' to 'Z' workbooks. We have to delete them, and replace them with new files, that have the same name.

Is there any VBA code or something that I could run that will update the links to pick up the new files?

View 2 Replies View Related

Workbooks Collection - How Many Different Excel Files Are Open

May 3, 2012

I'm trying to determine how many different excel files are open, but my VB program runs outside of excel (in a program called Pulse).

Here's the code so far:

set ExcelApp=CreateObject("Excel.Application")
ExcelApp.Visible=True

For Each Workbook in ExcelApp.Workbooks
MsgBox(Workbook.Name)
Next

Msgbox(ExcelApp.Workbooks.Count)

The only message box I get is the last line of code, and it says "0" even though I have multiple excel workbooks open.

View 3 Replies View Related

Find/Locate Files/Workbooks Containing Macros

Oct 4, 2006

Is there a way of finding all files in a directory which contain a macro? I have script which will loop through all files in a folder but I don't know, and can't find, the appropriate syntax for referencing macros/modules.

View 9 Replies View Related

Open Files & Copy Data Between Workbooks

Sep 15, 2007

Simply trying to copy data from one worksheet to another. The source sheet is an excel file exported from an Access table. I recorded the macro using the recorder in Excel because I am no programmer, but when I try to run the code, I get this error:

"Code execution has been interrupted" ...and the Range I tried to select in the source file is highlighted by the Editor.

Is the source file protected somehow?

My ______________________________________________________________________________

Private Sub Workbook_Open()

ChDir "P:Databasesdownloads"
Workbooks.Open Filename:="P:Databasesdownloadsheadersflat.xls", Origin:= _
xlWindows
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Windows("ExcelTool.xls").Activate
Range("A1").Select
ActiveSheet.Paste

View 9 Replies View Related

Merge Same Cell In All Files/Workbooks In Folder

Jun 6, 2008

I have a folder named DATAENTRY (consist 90-100 password protected files & it may increase whenever the need arises).

I need to merge A2 to (data in last available row & last available column) of each file in that folder into a single sheet named MERGEDDATA of file named MASTER.XLS.

I got one excellent code to unlock/lock the files automatically without opening the concerned files. This is the Link [url]

& the Code is: ...

View 5 Replies View Related

Excel 2007 :: Updating Workbooks Containing Links To Other Files

Sep 12, 2010

I and my organization have many files created using Excel 2003. I have now upgraded to Excel 2007 and soon I discovered a huge problem.

- When opening a file using Excel 2007 that was created with Excel 2003 the links in that file is automatically updated even though I get the edit links dialog and choose not to update.

After searching for a solution on the Internet I realize that this is a problem that exist when Excel opens a file created in an earlier version. Microsoft has no solution.

I need to be in control of which links that are updated and not.

Going back to excel 2003 is not an option. Saving the source files in Excel 2007 is not an option.

View 5 Replies View Related

List Files/Workbooks With Full Path & File Name

Sep 6, 2006

I do a search on my directory for all *.xls files each month which produces a list some 11,000+ lines long. Attached is a very small sample.

I then import this into Excel – see tab Raw Data

What I want to produce is a list shown on tab Finished Data, so that I can then sort etc.

Has someone already done this before and got the code, or can someone point me in the right direction on how to arrive at the finished data?

View 9 Replies View Related

Nested Loop Not Working; Pulls Data From Multiple Files Into One Table

Aug 8, 2006

I've got this code that pulls data from multiple files into one table. the file name is in the top row, and each file's title, and two different sums display below that. Then it is supposed to loop through and display each task and the start and end date for that task within each file. After that the first loop brings it to the next column and file. The primary loop works fine, but the inner loop only seems to run once, as I get only the first result for each file. All I can figure is that maybe my row numbers aren't resetting like they're supposed to, or I'm completely overlooking something, which is likely, as VBA is by no means my forte.

Sub Worksheet_Calculate()
Dim sBook As String
On Error Resume Next
Application.EnableEvents = False
Col = 8
' Sets start column
Do
sBook = Cells(2, Col)
' References file name
TaskRow = 6 ........................

View 5 Replies View Related

Splitting Files Into Multiple Workbooks On The Basis Of Specific Column?

Jul 6, 2014

I have excel data file where the code can split the data into different xls file on the basis of country for first sheet only.

execute the code so as to create single country wise files for all sheets. i.e. file consisting of data with sheet A1,B1,C1. The present code works only for sheet A1 and it creates different files with data related to that country. I was looking for the output file with B1 and C1 as well for that country. Also new output file needs to be renamed just as of original one.

View 3 Replies View Related

Create Subfiles From Master File Using Key To Split Workbooks To Separate Files

Jun 13, 2013

I am trying to make my macro more dynamic for a spreadsheet I am working on. I have this code which splits out worksheets (using the specific names of the worksheets-not dynamic) from a main workbook into template workbooks (which are basically just an empty workbook because I didn't know how else to do it) and then saves them using the paths below. I would like to make this more dynamic by splitting the different worksheets into new workbooks based on a key column in the hierarchy worksheet.

Basically I have a list of accounts in column B with the file name they should be exported to in column A. There are about 30 accounts being split into 6 different region files. Also note that the same account might be listed multiple times in column A (needed to add multiple numbers for other lookup formulas in the worksheets) but that account worksheet will still only be going to one of the six region files and not to multiple regions. After these are copied to an individual file I would like to save it to a location on my computer. All files will go to this location.

VB:
Sub Create_Subfiles()

Dim FDMName As String
Dim FBName As String
Dim DIYName As String
Dim WMName As String

[Code] .....

View 3 Replies View Related

Macro That Takes Workbooks Or Files And Runs Them Through Another Macro

Apr 25, 2007

i need to make a macro that takes workbooks or files and
runs them through another macro. i already have the 2nd macro
done and it is working perfectly i just need to know how to make the one
that finds the other files and runs them all through the macro i already made. My boss said that he will have about 150-200 files to run through this macro.

View 9 Replies View Related

Macros That Were Working In Excel 2003 Are Not Working In 2007

Jan 25, 2010

I have a workbook in excel 2003 which I had been running the following macros (listed below). We recently upgraded to Excel 07, and neither are working. When I try to run them, the "debug" option highlights the following line in the sort macro "Range("A2:z" & lastcell).Sort key1:=.Columns(1)". This is driving me crazy, as the macros worked perfectly under the older version of Microsoft. Is there an issue with crossfunctionality between '03 and '07'.

Private Sub Worksheet_change(ByVal target As Excel.Range)
If target.Column = 1 Then
ThisRow = target.Row
startRow = 1
i = 1
Set ws = ActiveSheet
maxRow = Cells.SpecialCells(xlLastCell).Row
maxCol = Cells.SpecialCells(xlLastCell).Column
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
Do While i

View 9 Replies View Related

Copy Worksheets From A Couple Of Workbooks To Other Workbooks

Jun 26, 2014

I have 25 files with certain worksheets that I need to move to 25 other files.

Worksheet 1, 2, 3 and 4 in Workbook A needs to be moved to Workbook A-2014 Worksheet 1, 2, 3 and 4 in Workbook B needs to be moved to Workbook B-2014 Worksheet 1, 2, 3 and 4 in Workbook C needs to be moved to Workbook C-2014 etc....

Is there a way to do this with a macro? Preferably I would like to do this automaticly - i.e. runing the macro from a master file that

1. Opens Workbook A copies the worksheets
2. Open Workbook A-2014 paste the sheets
3. Save and close Workbook A-2014
4. Close workbook A without saving

then doing the same for Workbook B, etc.

View 5 Replies View Related

VBA - Carry Out Task On Set Of CSV Files - Return Values And Leave Files Untouched?

May 14, 2013

Trying to write a script to carry out a number of tasks but is there code to enable an Excel to look in a particular file for the list of csv files - carry out the tasks and return the appropriate values in the Excel sheet whilst leaving the original csv files untouched?

View 2 Replies View Related







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