I want to include just one column from a spreadsheet in print area but users can add a lot of rows so the column can grow dynamically. I want that column to be entirely included in print area. So, if say 10 rows were added, it would print those new 10 rows too. How would I do that in Excel VBA? There seem to be several methods of going about it from what I saw on the web but I am using this for the first time so I would appreciate your input on this. Thank you.
You do not need VBA for this.
Here is what to do.
Switch to the sheet you wish to have the dynamic print range on, say Sheet1.
Open the Name Manager with Control-F3.
Click the New button at the top.
For the Name field enter: print_area
For the Scope field select Sheet1 (or whichever sheet you are on).
For the Refers To field paste this formula:
=$A$1:INDEX($A:$A,MAX(IFERROR(MATCH({"*";9E+99},$A:$A,{-1;1}),1)))
Click OK and then Close
That's it.
Now as column A is added to the print range will include all of column A and nothing else... for that sheet only.
Note: If you want this for a different column than column A, simply change the A's in the formula to the different column label.
Related
I have a spreadsheet full of data (simplified example below) that I would like to extract the number in the well underneath of "Gimme the number" and paste it into a new column on a separate sheet (i.e. if "Gimme the number" is in G6, I would like to retrieve the value for G7). I do not have access to Excel VBA and have not used macros in the past. I found some examples linked below, but, from what I understand, they would return "Gimme the number", or "Gimme" not 19, 20, and 21. I am not sure if a pivot table is appropriate, because I only want information from a single column. I will only have up to 11 values to extract at any given time, so I think a formula would do it. I am just having a hard time coming up with one that works. Any help would be greatly appreciated!
Search for a text string and return multiple adjacent values
Return multiple matches with wildcard vlookup
I am not sure I get the question well, but I try.
First add a column right of the column with "Gimme..." values. Name it e.g. "Next_value" in the first row. Put in the formula referencing previous column next row. If "Gimme..." is in the cell (for instance) E6, than your formula in the cell F6 is =E7. Copy that formula into the whole Next_value column.
Than select area of these two columns (Label, Next_value) and apply the filter from the Data toolbar. Use the small buttons with triangles at the top of the column Label to adjust the filter so only "Gimme..." rows are filtered.
Now, copy values of Next_value column where you like. If you want just the references, use Paste special function from the Home toolbar and click Paste link button.
I have no coding experience, just trying to pull together a function within a spreadsheet at work to save everyone a lot of time - would be great if anyone could help me!
So I have an excel workbook, which has multiple columns of values within one sheet, which I would like to copy across to another sheet. But I only want to copy specific columns, dependent on the presence of a value in a different column for each row.
So for example:
Sheet 1
So I'm looking for a way to check for the presence of ANY value (ie just not an empty cell) in column C, and if there is a value present in column C, to then copy the values from columns A and B into a separate sheet in the workbook. I would need it do this check for each row within sheet 1 and copy them all as separate rows into sheet 2.
Is this possible?? Ideally without the use of VBA as I have a feeling adding this in to an already shared workbook may slow it down to the point of not being able to be used?!
Thank you!
Assuming Sheet1 is as follows
Then in Cell A1 of Sheet2 enter the following formula
=IFERROR(INDEX(Sheet1!C$1:C$5,SMALL(INDEX(NOT(ISBLANK(Sheet1!$C$1:$C$5))*ROW($C$1:$C$5),0),COUNTBLANK(Sheet1!$C$1:$C$5)+ROW($C1))),"")
Drag/Copy down and across (to right) as required. Change range as per your data. See image for reference.
I have a range C7:AD7 in workbook1 where C7:AC7 are random numbers and AD7 is the SUM of all those numbers. However, the SUM column shifts to the right after the user inserts a new column and enters a new random number. I have another workbook2 where I'd like to link to the SUM column and have the link automatically adjust as the workbook1 SUM columns moves to the right.
Can someone help me with this? Either VBA or through a formula?
Thanks
Jake
Give the cell a range-name (a defined name). Click in the sum's cell and go to the Formulas tab (Excel 2007/2010), Defined Names group and click Define Name. Type a name (without spaces) and click OK.
Open both books, begin a formula in the other book with '=', click to the other book and click on your named-cell. Excel will use the defined-name in the formula.
The defined-name will move with the cell, when a column is inserted.
I'd like to know if it is possible to link two sheets so that if I add a row in one sheet it autmatically gets added to the second sheet.
Thanks.
Not exactly -- I'm pretty sure you can't link an entire sheet. But you could use formulas with cell references, e.g. =Sheet2!B2 refers to cell B2 from Sheet2.
You could also try the vlookup() formula function. If you have a table defined somewhere in the workbook, you can use this function to return the value from one column of the table based on the supplied value from another column in the table.
You can "Group" sheets together by holding down CTRL and selecting the tabs of the sheets to be grouped. Adding and deleting rows and columns would result in the same treatment over all the selected sheets. But this is temporary and is lost as soon as another sheet is selected or the file is closed.
For a longer term entanglement, you would need VBA code.
!
Hi I am using Excel 2003. I need to add data validation to a column, it should display the two columns in the cell, when user selects, the 1st column value should be displayed in cell.
Ex:
Col1 Col2
IND India
CHI China
Column - display to select
Column
IND-India
CHI-China
after selecting CHI the China or CHI will be displayed in the cell.
Is there any possibility to do the process in Excel.
Thanks in advance for any help...
(1)
If you need a dropdown item to display a different title after being selected, you can have another cell serve as the display. For example:
Where B3 (the helper cell) can have a formula like =LEFT($C$3,3) or use INDEX/MATCH to look up keys (like in your 'For Validation' table).
And where C3 (the data validation list) has a custom format like ;;;"(Change)" or "(Select)" or even a symbol like "↓", and will never display the actual selected list item.
You can also do this with VBA by creating an activex combo box control.
(2)
If you need one dropdown list to depend on the selection made in another, you can use dynamic dependent data validation:
http://www.myonlinetraininghub.com/excel-factor-19-dynamic-dependent-data-validation
Go to Devloper tab - insert - active control- insert comobobox
draw comobox in your excel sheet
right click on combobox, open property
in listfill range, type range of your column
set coloumn count = 2
change the widht of colomn
You can use the dropdown menu for the first column and the VLOOKUP function for the second column.
VLOOKUP would look at the first column and based on what's there would fill the second with the data from somewhere else.
I've also found a YouTube tutorial on how to use the function. Here you go:
https://www.youtube.com/watch?v=-WAEzokHSJM