For an application of protocolling some measurements and therefore made a design for the print out of the data. This is a fairly complex design with many highlighted area, marked cells, font size changes, background color, pictures and so on.
My question is: Is there any way to get the design as a VBA code to "store" it without doing it all manually?
I already tried around some with the macro, though I couldn't "read" the current cell design.
Thank you in advance
You could save your empty templates on hidden sheets and copy the required on to the "print" sheet. Storing all of the formatting in code will be difficult to manage unless it's very basic formatting.
Related
it sounds simple but I am struggling
Do you know how to password protect a single sheet (there’s multiple sheets in the work book) so that you can only view it with a password. So the user can’t see it with the ‘read only’ option, I can only seem to be able to do it to the whole workbook. But just need it for 1 sheet only?
Thanks
A visually undiscoverable and password-protected sheet. C4 has test, but you can't see it. I also removed gridlines for grins.
I thought about this for a bit, and here's my best answer:
Change the cell and font colors to be the same
Protect the sheet and disable the ability to change ANYTHING.
Hide the sheet, if necessary.
This would force someone to:
Have the password.
Select All fields on that page, and then change the font color.
If memory serves correctly, this can easily be hacked by importing the workbook to Google Sheets, converting it to a Sheet, and then re-exporting it back to XLSX. In other words, don't be trying to hide anything TOO sensitive here.
I could not find an answer to this, neither on Stack or on the wild web. I have a sheet where I need users to be able to use Text to Columns, however, I also need to protect the sheet. Everything works fine if Excel automatically does this (from Text to Column "short-term memory"), but I cannot access the option when protection is enabled.
It is not that any text is spilling onto locked cells, it's just that the option is greyed out after protecting the sheet. I would appreciate a non-VBA answer as I do not want to use macros on a shared file (the server is extremely slow and even normal excels take ages to save). However, if absolutely necessary, can you ninjas please tell me how I can set it up so that this problem is solved with the least possible performance hit?
P.S.: I am pretty new to VBA (practically uninitiated, I prefer R for everything). Also, the shared server is basically a network folder, so it is not likely that it will cause any issues other than being super-sloth.
If you protect a sheet, then only unlocked cells can be edited, that is, users can change the cell manually.
That is the core and purpose of sheet protection.
In a protected sheet you will not be able to perform a text to columns manually.
Whether or not the file lives on a server is totally unrelated to using VBA for a solution.
The real question is: What are you trying to achieve? Your question is about running Text to Columns on a protected sheet, but if you step back from that particular approach, there may be other ways to achieve what you really need to do.
You can easily fit the content of your cells by selecting a series of columns and double clicking with your cursor between two cells. However, if you zoom in or out the rendering of the cells changes and what had been autofit changes relative to the size of the cell and you end up with a #####.
Is there a way to autofit cells that will hold irrespective of the level of zoom?
This is probably more question for the software development team at Excel but perhaps a VBA band-aid fix could be implemented in the interim, if the problem is ever addressed.
Thanks!
Unfortunately the zoom level (by scrolling with the mousewheel) by default cannot be captured to trigger a VBA script.
The only solution seems to be to have a VBA subroutine running in the background constantly that stores the current zoomlevels and the sheet they apply to in a Public variable.
When that variable is different from the one currently observed from the application you need to activate Autofit for all the worksheet columns again.
Alternatively you could just store a single number (THE zoomlevel), then when you switch between sheets that have different zoomlevels the subroutine will immediately Autofit for the sheet you switch to.
Ofcourse you have to consider the intervals at which this is done.
Last alternative is to Autfit manually whenever you spot such occurence...
There is a menu button who does that automatically. For me it is in the Ribbon "Start", than "Rows" , than "Format" than one of the Columnwidth options.
Excuse the vague description, I am using a german version of Iffce.
I want to print a row in Excel.
One row contains data for one project.
I want to print one row on one page nicely formatted. Meaning the value of one cell is the header and should be printed fat and centred, the other values should also be placed at fixed positions on the page.
Is this with VBA possible? When I was searching for this problem I only found results for printing a worksheet or a table or parts of it, but no results to use the values of the cells and formatting them.
Thanks in advance
As the other answers indicate, it is certainly possible in Excel VBA, but it is not really Excel's strong point.
What would typically be done to obtain the result you seem to be after is use a fully formatted Word document with fields that are then filled in with values from an Excel worksheet. You can even cheat a bit and use the Mail Merge \ Letter wizard to set everything up.
If you do want to do it all in Excel, you can find instructions and an example VBA macro here:
http://www.tek-tips.com/faqs.cfm?fid=4223
Template is a good way to do. With a macro there's better performance where it avoids the usage of volatile functions such as INDIRECT() However again it depends on how many volatile functions your worksheet carries.
Yes, it is possible when you use the Styles in excel. I know you can do Font formatting quite easily. Not sure about indenting it, but worth a try.
If style doesnt support it (it might in Excel 2010), you can always indent it via VBA (record a macro when you indent the values , it should look like this):
Selection.InsertIndent 1
A tricky one, I assume. However, is there a way to make use of a selected or clicked cell in Excel somehow without the need for VBA?
(I know how to do it with VBA, but macros are macros, but if you want to give workbooks to people...)
For instance, I would like to make some of the content in the freezed section to be dependent on where in the sheet someone is. It would be optimal, if the selected cell/row would be trigger enough.
It would be also okay, if clicking a cell (e.g. a link navigating in the sheet) would trigger the conent to change. Hence, a solution would be to make a hyperlink change a value in some cell somewhere. I know, this is a different question, but it should be all accomplishing the same goal of the line on top ;-)
Thanks a lot!
You cannot change values or display of another cell with formula or functions.
The hyperlink will send you to another location but won't change the freezed part, except if you only freeze rows and the hyperlink send you to a further column. But you will have then to really think about your layout very precisely. Moreover, the user will even less understand what happens unless you can design a great UI (but Excel may not be the best tool though).
Some tips:
Use hyperlinks but on differents sheets
Use "transparent" macros (without big buttons but rather event vba as you pointed out)
Sorry i don't have a magical solution.