I am in the midst of converting an amazing made-with-excel "application" coded entirely with VBA.
In one of the .xls file, and in its first Sheet "input", it has a bunch of dropdown boxes. selecting one of these dropdownbox will show in the formula bar:
=Calcs!$H$15
Now, the issue is that there is only one visible worksheet in the .xls at the beginning, and even after I unhide Sheet, only one other Sheet "report" appears.
But if I go into developer VBA mode, I can see the "Calc" sheet in the VBA Project panel, along with the "input" and "report" sheet, and also many other sheets that are not visible via unhide Sheet. But in VBA, the contents of these sheet is all empty (ie. there is no code in the sheets).
Now, my question is, how can I view the contents of Calc sheet and the rest? To see the cell values for the dropdownbox, and also other things?
If the sheet property "Visible" is set to xlSheetVeryHidden it will not show up in the list of hidden sheets. Change the property to either xlSheetHidden or xlSheetVisible in the VBA editor.
To make it appear, do as follows:
Double click the sheet within VBA
Open 'properties' (shortcut is F4)
Change the last property -1 xlSheetvisible
Rgds
Edit: Ups, already answered, sorry!
Related
I´m using VBA userforms to fill values from the textboxes into cells of a specific sheet. Lets says the Sheet is named "Sheet1", the textbox is called "TextBox1" and the cell is "C2". I´m currently using
ThisWorkbook.Sheet1.Range("c2").value = Userform1.TextBox1.Value
to fill the cell with the value that I have typed into the textbox. Now I have experienced that when I have multiple copies of the same document opened, it doesnt always put the value in the intended document, but into the copy (which also has a sheet called "Sheet1"). Is there a way around that problem?
I am creating a VBA code to select 3 specific tabs to convert into PDF. I want to be able to select 3 specific sheets from the list of sheets in "Microsoft Excel Objects" so that even if the order of the sheets is changed or sheets are renamed, the same tabs will be selected and converted into a PDF.
At the moment, I have this code to select the first 3 tabs. (which works fine)
Sheets(Array(1, 2, 3)).Select
I have tried the below (doesn't work)
Sheets(Array(Sheet1, Sheet2, Sheet3)).Select
Expected result is to be able to select 3 specific sheets from the list of sheets in "Microsoft Excel Objects" so that even if the order of the sheets is changed or renamed, the same tabs will be selected and converted into a PDF.
You need to use the names to do a multi-select. But you can refer to the codename to get the name: Sheet1.Name
Sheets(Array(Sheet1.Name, Sheet2.Name, Sheet3.Name)).Select
You would change the Sheet1 and others to the CodeName of the sheets you want to select.
One way is to assign a unique CustomProperty to each sheet you want to export:
Sub qwerty()
ActiveSheet.CustomProperties.Add Name:="PDF", Value:="pdf1"
End Sub
and similar for the other two sheets.
Then when you want to export, loop through all sheets looking for the proper CustomProperty. It won't matter if the sheet names have been changed or the CodeNames have been changed or the order of sheets has been changed.
Suppose, I have three Excel files, say Excel_1, Excel_2, Excel_3, how to quickly combine them to a new Excel with three sheets such that, sheet_1 is Excel_1; sheet _2 is Excel_2; sheet_3 is Excel_3.
Manually speaking:
Open all Excel files.
Right-click on the sheet, select "move or copy" and in the new window select your Excel-file which shall hold the sheets. Click Ok.
Just Drag the sheets to new excel file.
Open all the excel sheets you want to merge, then at the bottom left you can see the sheet name, drag that sheet and point to the minimised excel icon in the taskbar, then point to the excel sheet you want to paste the sheet, when that sheet comes up just release the mouse. All done
How to quickly copy a whole Excel spread-sheet to another Excel spread-sheet by value? And how to quickly copy some sheets of an Excel spread-sheet to another Excel spread-sheet by value? Without using VBA (Visual Basic for Applications).
For example: suppose I have a spread-sheet called Excel_A with several sheets and with lots of formulas. I want to quickly copy all of Excel_A's values. I want to avoid copying sheet by sheet into another spread-sheet because it will be too slow and there are a lot of sheets in Excel_A.
A simple, dirty workaround, not involving code (which you don't seem inclined to write) is the following:
Save Excel_A As Excel_B
Right-click on one of the sheet handles at the bottom, and click Select All Sheets.
Ctrl-A to Select All, Ctrl-C to copy, Alt E-S-V and Enter to paste values.
Alternatively, it's definitely doable with VBA too. Something similar to the below ought to work. (It assumes both workbooks are open, otherwise replace the names with addresses.)
Sub CopyValuesToNewBook()
Dim wbA As Workbook
Set wbA = Workbooks("Excel_A")
Dim wbB As Workbook
Set wbTest = Workbooks("Excel_B")
For Each Sheet In wbA.Sheets
Sheet.Copy
Dim IndexNo As Integer
IndexNo = Sheets(Sheet).Index
wbB.Sheets(IndexNo).PasteSpecial Paste:=xlValues
Next
End Sub
There is a simple approach that you could follow,
Copy the ranges that you want to copy-paste. Open a new text document and paste it in the txt document. CTRL+A (select all) in the txt file, copy everything and then paste it in the required excel sheet. This would eliminate all the formulas in the cells and would copy just the values in the cell.
If you want to copy the entire sheet, select all (CTRL+A) in that sheet and do the same. You will not be able to copy-paste sheet using the normal way. This can be done sheet by sheet only unless you develop a macro or something else. Hope this helps
in excel 2007 I have a spread sheet that has hidden sheets. I know all the passwords. To unhide sheets I'm supposed to right click on sheet name tabs on the bottom and click unhide. However the unhide option is greyed out.
the hide - unhide under Home > Format is also greyed out.
I have a password for the whole sheet, but I don't know where to enter it.
I hate excel 2007 ribbon structure.
I figured out the Answer and it is:
Ribbon > Review > Protect Workbook
Unclick - Protect Structure and Structure
Enter the password and the menu items are enabled
Thanks everyone for the assistance.
Did you hide the sheets yourself or did someone else do it?
It's possible the sheets are "very hidden"; see this link for more information. You may have to use ALT+F11 to go into the Visual Basic Editor and change the sheet's Visible property.
for each worksheet ws in activeworkbook
begin
ws.visible = true
end
Correct the syntax if need be, but the above VBA should unhide all hidden worksheets.