Set specific height for all existing/new rows of a table - excel

I have used Excel for quite some time now but only using traditional formulas. Now I am trying to create a more elaborated document for my business using VBA coding to expand my possibilities.
I have done some research and started practicing but found something that I can’t understand how to do yet.
I have a worksheet with a table on it. Since this is a fresh document it has nothing but the header and a blank row below it. What I always did when writing the information was type text in any of the columns that belong to the row immediately below the table (without actually inserting a new row myself). This creates a new row for the table where most of its format is kept, such as text size and formulas. However, I noticed that the row height doesn’t automatically change to that of the previous rows of the table, and changing it manually for each new row is very time consuming.
I would really appreciate it if anyone could share me the necessary Excel VBA code to fix this issue. I have thought of two possible approaches. The first one is a code that automatically sets all the rows of the table to a height of 20 (I want all rows to be the same size so no problem with that), supposing this would also affect new rows as I add them the way I mentioned. The second one would be a code that automatically sets every new row of the table to a size of 20. It doesn’t matter which one you choose, the easiest will be just fine. Thanks in advance.

Related

Message error in Excel _how can I solve it?

Can anyone tell me how can I solve the following error? I get this error every time I enter a value in my cells. This Excel has a VBA script and based on the entered values, it runs a stored procedure.
The Excel runs correct, is just that I get this message all the time.
It seems that your code tries to add or remove a row in the upper table (unfortunately you failed to show the code).
Your tables don't have the same number of columns so when adding (or removing) the row would move only a part of the lower table(s) down which would corrupt the layout.
Possible Workarounds:
Instead of inserting a table row, insert a row to the whole sheet.
Organize your data so that tables are not stacked (show the tables next to each other, not above each other)
Make sure all tables have the same number of columns.

how to insert a date stamp into a table when a row is added automatically

I am wanting to update a table we have for outstanding issue in one of our projects so the date of issue being raised field is prepopulated when a new row is inserted in the table. the reason for doing this is I'm aware users occasionally will miss this field when adding data to the table and when going back it is hard to remember when you you raised the issue in the first place.
VBA is not my strong suit but I understand just about enough to get by and know the code I need for inserting the timestamp into a cell and just need to work out how to direct it to the right part of the table but that shouldn't just need to point it to the last row of the table and the column can be feed by its header.
What I'm more stuck on is how I get this done without having the user notice so no need for a macro button to add rows etc. I believe this should be doable using the change event handler but I just don't know enough about how I'd set this up. any advice would be appreciated
if you require any sample code I'm working or a mock up of the table let me know and i'll pull something together.

How to "protect" certain fields (to avoid row spacing) in huge excel data set

I am having huge data set, and every-time I am adding new row into it (middle of the table), the tables on left and right side are disrupted. Is there any way to "lock" these tables during my edit or ? On protection sheet tab i cant find solution.
That red part is actually non-disturbed table (should be), but always getting one row of spacing when adding it, I have manually to select exactly which row and how many columns in the middle part, it is time consuming.

VB Excel - Print set columns on diff pages

I have been given a very ugly excel document which I need to be able to print the first 4 columns off every time and then loop through each of the next columns so they only print one at a time per sheet as if the first 4 columns were frozen and then each of the others prints off one at a time in turn.
I have tired a number of different approaches to this from hide, unhide to looping and active cells but I cant seem to find the best and most efficient effect way to do it.
The first four columns contain standard headings as titles and then the subsequent ones relate to a specific object - I want to be able to use VB to press a button and print out the heading columns and then effectively each object column on its own page so its like every object has its own page with heading to go into a ring binder file. Hopefully allowing each object to be quickly viewed independently without the data of the other objects if I was viewing the whole spread sheet. Effectively each object on its own page with the default headings, each object is a different column.
I am sure there is a simple way to do this and I am over complicating it!
Any help welcome.
Thanks

Excel 2010 check cells in a row contain data before the Selection Change fires

I have an Excel 2010 data table which is driven by a query from MSSQL. The underlying query changes depending upon what options the user selects in the Excel workbook. I'm okay with changing the query and pulling the data.
After the data has been selected multiple users will be able to edit and append data to the Excel table and these changes will post back to the SQL database table. Due to the database table structure some of these cells within a given row are mandatory before any data can be inserted into MSSQL and/or potentially updated.
So what I'm trying to achieve is checks on whether certain columns in a row are blank after a cell is edited (I can do this via Worksheet Change) and also before they move off that row so I can bring up a message if all mandatory columns haven't been entered. I can't see any events that fire before Selection Change. My only thoughts on a workaround is to have a global variable row marker that is updated on Selection Change, i.e. it will store the previous row number. I can't use Excel's standard data validation functionality looking at blank cells because although this is fine for a currently correctly populated row that is being edited, inserting new rows or appending directly to the bottom of the table will constantly error as all those mandatory columns will, of course, be blank. Currently I am using conditional formatting to at least highlight columns/cells that require input although this doesn't force users to actually do it. Data cannot be stored within MSSQL until these columns contain data so if they don't fill them in and refresh the table for whatever reason, whatever they have entered will be lost. Obviously this is bad, m'kay. I am concerned about both the Worksheet Change and Selection Change events constantly firing and how that will affect workbook performance.
Any suggestions would be appreciated. Maybe I'm going about this all wrong so any ideas to make this more efficient would also be well received. The user base do not want to see UserForms or MS Access even though it would make this activity very easy. They are too used to the look and feel of Excel sheets.
your best way is to copy the table into 2d array or some other data structure in memory such as dictionary or collection. and than manage each change in memory. this one is very efficient but requires a lot of code. with excel the only problem you have is the key the rest is vlookup and true false questions. vlookup will find the original value and then you have current data + previous data + the logic... is the new data ok?

Resources