I need the code to allow a user to select a column of their choice in an open workbook of their choice so that data can be lookuped up and changed. I am happy to create the code to do the lookup/changing, however the nearest I have found is the use of an inputbox which is limited to the active spreadsheet only. Some people have said the input box could be used over to another spreadsheet but I have not found that to work.
What I will need returned is the workbook name, sheet name and column. That will allow me to point to that and do the task.
This code could be used by 5 people and those 5 people could be running it on 20 different spreadsheets.
I thought this would be easy to find but it has eluded me. When using Excel normally, if you do a simple lookup formula, or create pivot function, excel prompts the user to select the workbook/sheet.
I recorded a Macro to open a specific sheet and it works fine however I want to go to the next step and have the sheet open to a specified column in the sheet based on the column in cell 'H2' on the current sheet.
I use excel 2002 but some of my office are on 97, i want to add a small workbook open event code which works for me but debugs for the others?? The code is basically, go to a tab, on that tab and that range sort..
I have a work book with many sheets and staff continue to mess this up so I would like to know how I can have a specific sheet called Instructions open when this workbook is opened preferably no macro's is this possible
Problem: I want a macro to detect if a workbook is open so I can skip the workbook and move onto the next item. I do not want the user to be prompted in any way. I do not want the workbook to be shared. I simply want to pass over the workbook (but be aware I have passed it over).
--Long Version-- About forty team members have their own workbooks and at dayís end the team leader uses a macro to poll each team memberís workbook in turn to gather work results. When gathering these results the macro also needs to write some admin data to each workbook.
I am aware of the workbook sharing option in Excel, but I am wary of using it. It is not a show stopper if a team memberís workbook is already open and work is not gathered on a particular day Ė weíll get it the next day. I just need to be able to trap the event and manage it. The central command I use to access a team memberís workbook is :
Private Sub ComboBox1_Change() 'was A, now N DataReport.ComboBox2.Clear If Data5m.FilterMode = True Then: Data5m.ShowAllData Data5m.Range("A1").AutoFilter field:=14, Criteria1:="=" & DataReport.ComboBox1.Value Call FillCombobox(Data5m.Range("X2", Data5m.Cells(Rows.Count, "X").End(xlUp)).SpecialCells(xlCellTypeVisible), DataReport.ComboBox2)
I have below code, which copy the sheet from different workbook and paste it in current book. How to ensure that below code find Sheet name "Create Positions" and copy that sheet data only and not other sheet?
I'm trying to figure out a way to find a specific sheet in a workbook that does not contain the macro. Within the macro I have a cell which holds the name of the specific sheet I would like to find but I can't get it to work for some reason...
'Dim officen As Integer 'Dim thiswb As Workbook
officen = Range("A2").Value Set thiswb = ActiveWorkbook ' Open the Active Info file Workbooks.Open "C:My DcoumentsActive 20080616.xls", , , , "xxxxxx" ' Dim sourcewb As Workbook Set sourcewb = Workbooks.Open"Active 20080616.xls"
I managed to create some code that will connect to a workbook and take the data from there.
It is kind of SQL mixed with VBA. I just got this by finding it in google (I don't have the link handy now).
What the file does, is it will take 2 columns from a workbook called "Test.xls" and then take out 2 columns "Name" and "ID".
The only thing is, this is only a test and not the actual files I need to open. the files are always saved on the same folder, but the name is the day of the export of it. So when I export a file today, it will get 2014.09.10.xls. The sheet (only 1) will also get that name.
How could I change the below code that it will take that file based on today's date and read from the sheet with today's data?
VB: Sub sbADO() Dim sSQLQry As String Dim ReturnArray Dim Conn As New ADODB.Connection Dim mrs As New ADODB.Recordset Dim DBPath As String, sconnect As String 'DBPath = ThisWorkbook.FullName
I want a specific workbook to be always on manual but when I open other workbooks I want them to remain on automatic even though the first workbook is set on manual through vba code. Is that possible to be done?
This is the code I run:
Private Sub Workbook_Activate() With Application .Calculation = xlManual .MaxChange = 0.001 .CalculateBeforeSave = False
I know that Application. Calculation refers to all open workbooks but I don't know the code to specify the manual calculation to this workbook only while others are open.
I have been recording different sets of commands then copying/pasteing them together to complete what I want. I have tried to clean it up as best I can but im sure it does things it does not need to. Is there a way to tell it to select all sheets in "Book2.xls" then remove the formatting (font color,comments,shading) rather than using the Array and naming each and every sheet?
What this will end up doing is openeing about 12 files, copying specific tabs from each of those files and pasteing them all to the same workbook (in this example it would be Book2). Then removing the formatting.
VB: Sub openfiles()Dim Path As String Dim ExcelFile As String ' Path = GetFolder("C:UsersKinteshDesktop") Path = "C:UsersKinteshDesktopVBA programmingMaps" ExcelFile = Dir(Path & "*.xls")
NextCode: GetFolder = sitem Set fldr = Nothing End Function
My problem is that the code all actually works (including the function and when I use the commented part), but pointing to this one specific directory (the one I'm using right now), literally nothing happens.
I am trying to write code to open a new (blank) workbook while in an existing workbook (I am then going to pass data between the two which is easy). When I try to record the code to get the syntax for opening a new workbook it will not record any code. I also need to name the new workbook based on text in a cell in the existing workbook. I just saw before posting this that the code;
will open a new workbook now I just need to name the new workbook based on text in my existing workbook.
I have data in 2 different workbooks, and I need to transfer all data in 'Jx_ex1' to sheet1 in the 'template' workbook, and all data in 'Gr_ex1' to sheet2 in 'template' workbook. All data should be transferred to the same cell numbers, from A1 to Y5000. I actually have loads of workbooks to transfer to the template but if I have an example with the two then im sure I can work out how to modify it. All files will be in the same folder.
I am working on an existing large excil file with over 60 sheets. What I want to do is create a search box on the first page, our "main menu." The search is for an product ID Number and then will open up the sheet in which that ID # is associated with.
I am trying to write code in the VB behind Excel that will allow me to navigate to an excel file (can be open or closed) and delete it. ie navigates to file xxx.xls at N:/xxx/xxx/ selects the file and then deletes it.
I have a workbook with lots of code to automate several things that I do. It does a great job at doing things I need it to do, but it takes foreeeveeerrr to save the workbook. The code has made the workbook a large file, and it takes a few minutes to save it. Is there a way to skip saving the code everytime you open the workbook. I don't ever need to change to code so I don't need to save it every time.