I am working on an excel spreadsheet. I have a dropdown with values. I need to add a value in there.
There is no macro and there is no connection. The only thing I found was:
I selected the cell at hand
Data -> DataValidation
In the source i can see this string =Variables!$D$1:$D$23
I do not have a sheet called variables or anything close to the word variables in any of the sheets. Where can this be coming from?
There is also protection on the workbook but not the individual sheets. Could this be the issue?
Thank you
You can usually check the contents of a hidden sheet quite easy using the Immediate Window.
So open the VBA editor (Alt-F11), go to the Immediate window (Ctrl-G), and try:
?Variables.[D17]
If this works, you can repeat this to see the other 22 validation values (or write a small sub, using Debug.Print ubstead of ?).
Related
Let's say I want to copy Cell C5 from workbook 2 to workbook 1. The name of workbook 2 is a variable given in Cell D1 of workbook 1.
The problem with using Excel's built-in Indirect() function is that the value disappears when workbook 2 is closed. I'm hoping there's a simple VBA macro that can do this.
Thanks in advance.
You seem not to have a lot of experience in Excel VBA, let me give you the general approach for such an exercise:
You can record macros: go to the "Developers" tab, start recording, do the thing you want to do (the copying) and stop the recording. There should be a macro, describing what you have done.
Unfortunately, when doing this, the macro will be something like this:
Source_Range.Copy
Destination_Range.Paste
Generally it is advised to replace this by something like this:
Destination_Range.Value = Source_Range.Value
Good luck and if you have any more problems while doing this, you might ask again by editing your question (I'll be following this question).
The behaviour you're observing isn't a limitation of the INDIRECT() function, but a more general limitation of Excel functions only having access to other workbooks when they're open.
You can use another workbook as a data source by selecting Data > Get Data > From File > From Workbook from the ribbon. Select the source sheet from the Navigator pane, and select Load. This will open the PowerQuery editor.
PowerQuery is an advanced topic which I won't attempt to fully address here, but the default transformation should give you a table containing data from the source worksheet, without relying on that workbook being open in another instance of Excel.
Complete beginner with VBA and I think I'm doing something majorly wrong.
So context;
Creating a user friendly sheet to do checks on items etc. To keep it as simple as possible for other people I've decided to use drop down menus to input the majority of the data and tick boxes to say when the check has been done.
From here I want to add a big old button that will transfer the data from the cells, dropdown menu and tick boxes to another sheet or workbook.
I would also need the sheet or workbook to place the date the checks were done and create a new line with the information. So that I can look at a single sheet and see the wear and tear on the equipment in one form. (layout of this can be sorted out after wards just how to get it to go to a blank line etc.)
And finally to save the document.
drop down information is linked from another sheet within the workbook.
Now I've tried some code to work it out myself and it either doesn't copy the data as the cell is blank (drop down menus) or it just shoots up an error on the VBA page.
Could anyone assist in helping me work this code out? Even if its just the command syntax's that I would need to use.
Thanks in advance
Peter
I'm currently working on creating a dropdown list that hides selected items in Excel. I am using Excel 2016 and my file's type is Excel 97-2003 Workbook (xls).
The problem is, when I try to save my file, compatibility checker pops up. It only works on xlsx files. I think my formula for data validation could be the reason why. Any ideas or tips to fix this issue? Please. Thank you very much.
Here are the images
#cybernetic.nomad asks a reasonable question: "why not save it in .xlsx format?"
But if you really want to know why the compatibility checker comes up, the reason is this:
List Validation Ranges in Excel 97-2003 cannot refer to a range on another Worksheet (unless they are in a Named Range).
To get it to work with a Named Range:
copy your validation formula to the clipboard
bring up the Named Range dialogue (Ctrl+F3)
add a new Named Range (name=usernames, scope=Workbook, Refers To=[=your validation formula])
go back into the Data Validation dialogue where you want the dropdown and change the Source to "=usernames"
Ok this is kind of hard to explain.
I create a cell in my worksheet using JAVA POI
newCell= row.getCell(index)
if (containerCell == null) {
containerCell = row.createCell(index)
}
newCell.setCellType(HSSFCell.CELL_TYPE_STRING)
newCell.setCellValue(strVar)
If i then open the worksheet in EXCEL, I see that the cell value is indeed set. However if I load this into another external program that reads EXCEL sheets, it claims the cell I just set is blank.
NOW, if I go back into excel and do a simple "Hit return" on the cell in question, in the formula bar (even though its not a formula) and try to reload it into the external program, it works fine. Do I need to evaluate a formula on a string?
Thanks
I have no experience with Java, but having to hit enter in a cell is usually indicative of calculation being set to manual. Since you are working with API it may be treating your input from Java as a formula (?).
Open the offending workbook in its broken state, and on the sheet you are having problems with choose [Formulas] tab at top, then [Calculation]>Calculate Sheet.
If this updates the value then I see two options...
See if there is an option to manually calculate the sheet with POI, after the value has been entered.
Alternatively, you can write just a tiny bit of VBA to force calculation on that sheet when workbook is opened. MSDN offers a simple example.
http://msdn.microsoft.com/en-us/library/office/aa223802%28v=office.11%29.aspx
I have had to do this for Excel apps where calculation had to be set to manual to avoid excessive overhead. Just a guess though..
I am not sure why this was happening.. and evaluating the individual cells did not solve it however running evaluteAll() on the entire workbook made it work!
Alright I know this isn't 100% related to programming (the Excel book in question doesn't use VBA at all) but I'm hoping someone can help me out with this or point me in the right direction.
My boss got a spreadsheet from a vendor that has a combobox/dropdown list with various part numbers; when you select one it populates the rest of the form with a lookup containing additional items. I've been tasked with "cracking" this and finding the list that they're using to populate so we can make use of it.
The thing is... there's no VBA code, no macros, no data connections, and only one Worksheet displayed in Excel while the lookup code references a Sheet1. I've tried to display hidden worksheets and it says there are none... so where on earth could this list be kept? My boss is getting impatient and is asking me if I've broken it yet. It's not a big deal if it can't be done, I just have no clue where to continue looking for it and I don't know what to tell my boss when he asks me if I'm done.
Can anyone help?
It's possible to hide a worksheet using VBA so that it can't be unhidden from the UI.
Try the method for un-hiding all hidden workhseets outlined here:
http://www.automateexcel.com/2004/12/14/excel_vba_unhide_all_worksheets/
My guess is that it is a Data Validation list which references a constant list of values or a range on a "Very Hidden" sheet. In Excel 2007, select one of the cells with the drop-down, click on the "Data" tab in the Ribbon, click on "Data Validation" in the Ribbon and see what you have. In Excel 2003 it is the Data -> Validation... command.
Another possibility if you know the name of the worksheet is "Sheet1" is to add a new worksheet, enter "=Sheet1!A1" into cell A1 of the new worksheet, and copy this cell down and to the right for as large of an area as you need to see the data you are interested in.
If you can post a URL to download the workbook (assuming it is not a trade secret) you would be more likely to get an accurate answer.
Could it be some data stored on the same sheet.
Possibly in columns which are either hidden, or which are far off the actual page?
Isn't this just data from the worksheet only?
Column header dropdown lists acts as filters, they show distinct values of a column.
This is a feature of Excel.
The items could be cached from a currently unavailable resource. Try saving it out to xml and searching for a known string.
Click on the cell that display a drop down list when selected
From the menubar select data>validation
In the dialog box copy the content of the source text box
Now paste the content on any empty cell on your worksheet
Select a drag it down to see the values populating the list
Chris
------
Convert your Excel spreadsheet into an online calculator.
http://www.spreadsheetconverter.com
I am assuming that you have broken this by now, but just in case you havent. This is certainly a case of data validation using a named range which is house on another sheet that was designated "very Hidden" from the vba console. You will need to open up the VBA project of this worksheet and designated the "very Hidden" sheet to just Hidden and then you will be able to unhide it, or the other setting at which point it will be viewable.