I currently use a printed out grid to document my work, but its a bit of a pain to search through and organize. I'd like to go digital, but want to find an easy 'Save current Version' and 'Reset form' option.
If that's is unclear, I want to make a button that will save the spreadsheet, exactly as it is at the time of click (using a name I enter in cell A1), then reset the contents of the spreadsheet.
They can be two separate buttons if needed, but that is the minimum requirement.
I have done this before, and with a little planning can be accomplished through a recorded macro.
Steps:
Create 2 Worksheets, "Form" and "Data".
Design the form on the "Form" worksheet, and populate with sample data.
On the top row of the "Data" worksheet, create references to the fields you to record.
Now Go back to the "Form" worksheet. and start the macro recording.
Go to the "Data" worksheet, right click the row header below the reference row created in step 3 and select "Insert".
Right Click on the row header of the reference row created in step 3 and select "Copy".
Right Click on the row header of the newly insert row from step 5 and select "Paste Special > Values".
Go back to the "Form" worksheet and delete all the placeholder values.
Stop the macro recording and save.
Insert a button that points to the newly created macro.
You can also do this all with VBA, but for a simple task like this, the Record Macro function is perfect.
Related
I have made a Data Entry form in which i have recorded a macro Using "Use Relative Reference" from developers tab.
I have also added vlookup formula so that if a certain value or word is selected many of the fields being pulled or appears automatically.
I have created a button named as "Save Data" and have recorded a macro in it
After adding all the values (few values manually, few values I pull via Vlookup) whenever i press the button "Save Data" it moves the all values from data entry form to another Main Worksheet.
However the problem is whenever i press the button it also removes the formula of Vlookup and I have to either paste Vlookup formula again or add the values manually. the formula of Vlookup is
=VLOOKUP(C12,Functions!F$2:J$20,3,0)
Can anyone suggest if even after pressing the button and after moving the data the formula should remain there and i do not have to put them manually again and again
I have a large file with a Scenario Manager, where changing a single cell on the Summary worksheet changes the visible scenario throughout the rest of the workbook. Data Tables are working a treat providing the headline values for each option.
I'd like to have a drop down on each sheet that when changed will change the same single cell on the Summary worksheet, so I don't need to go back to the Summary sheet every time I want to switch visible scenarios.
This is a simple process if I'm using macros and would be the solution I'd normally jump straight to. But this needs to be done without macros and this is where I'm now struggling.
Does anyone know if this is possible (without macros) and point me in the right direction?
Josh
You can insert combo box (Developer Tab > Insert > Form Controls > Combo Box) on each sheet. Mention linked cell as a cell of the summary sheet (Absolute reference with sheet name). That cell will give you index of the item selected in the drop down list. Then you can insert index formula in the cell you want to change every time to get value of the drop down list. Once you insert it on one sheet you can copy it to other sheets. No macros required.
This question already has answers here:
Excel VBA: AutoFill Multiple Cells with Formulas
(2 answers)
Closed 4 years ago.
I want to sort data in a worksheet, which gets new rows daily, in a second worksheet.
The problem is, if I use the SMALL()-function and fill the cells automatically till the last row (A102482 or something like that), my file gets very huge and laggy (>20mb).
Of course the person adding a new line could expand the formula in the second worksheet into a new row, but this is not userfriendly at all!
What would be the best solution? I thought about vba-code, which counts the entries in the first worksheet, and then runs a code like this
for (i to numberrows; i++) { SMALL(A + i + 2*3, i) }
filling the first few rows in the second worksheet so the excel-file doesn't get too big...
Thanks in advance!
Edit.:
To be more specific:
What I'm asking excel to do is copy a worksheet and have the rows sorted on the second worksheet. And as the table expends, of course the sorted table has more values. This process should be done automatically, with the user only entering new data in the first worksheet and seeing the results in the second worksheet. Having the second worksheet's cells all already populates witht the SMALL() function is not an option, as this would work in my case, but this is way too slow and the files get too big...
I suggest making the second table, the dependent one, out of a PivotTable.
This will grow and shrink with the first sheet every time you refresh the data, which can be set to automatically refresh when you open the file. Here's how:
Use "Insert > Table" to format the first list. Then use "Summarize with PivotTable" or "Insert > PivotTable" (2 names for the same feature) to put your PivotTable on the next sheet.
Put all the columns you want in the second sheet under "Row Labels" on the PivotTable wizard thingy that appears.
Under PivotTable Tools > Design > Layout > Subtotals, choose "Do not show subtotals."
Under PivotTable Tools > Design > Layout > Grand Totals, choose "Off for Rows and Columns."
Under PivotTable Tools > Design > Layout > Report Layout, choose "Show in Tabular Form."
Note that if you don't have something unique at the top of the list in Row Labels, similar to "ID" in my example ( =ROW() ), the PivotTable will do intelligent things with the data that you may not want.
Here's how to get the thing to refresh automatically when the file opens. Alternately, you right-click on the table and choose "refresh".
If you wanted to refresh the PivotTable every time the data changes, put
Sheets("Sheet2").PivotTables(1).PivotCache.Refresh
(substituting "Sheet2" with the name of the sheet where the table appears; activating the data sheet on the left side; select Worksheet on the first pull-down, and select Change on the second pull-down to access the Sub Worksheet_Change code area)
...here:
Cheers!
I think I've found the answer here:
Excel VBA: AutoFill Multiple Cells with Formulas
Sorry that my question was so misleading, basically the above answer is all I was asking for... Thanks for your time and your answers!
edit: linked to the specific post containing the answer
So I have a packing list, which I have partitioned into separate sheets by category, so each sheet looks something like:
Item | Quantity | Box Number
hat | 2 | 1
So what I want is a 'master' sheet where all my items are listed across all sheets, so that I can sort by box number. This should cater for additions in the sheets and reflect that automatically in the master sheet. I tried copy and paste with links but that doesn't allow for additional rows.
Using Pivot table you can achieve this. Please follow the below steps
Create a Master Sheet and place your cursor at A1 cell
Press Alt+D and then P
you will get pivote table and pivot chart wizard
Select 'Multiple Consolidation Ranges' option
Click on Next
Select 'Create a single page field for me' option
Click on Next
Click on 'Range' edit box at the top
Select the first sheet where you have your first set of data
Select all the range that you wanted to include. You can include as many as empty row at the bottom
CLick on 'Add' Button.
Select the next sheet you wanted to add into your master sheet
Repeat the steps from 10 till all your sheets are included
At the end click 'Next'
Select 'Existing worksheet' option
Click on 'Finish'
If you want to add additional sheet you may need to repeat these steps again.
If you are adding any data into any of the sheet, then you need to click on 'Refresh All' from the 'Data' Ribbon, which will refresh the added data.
You can hide or filter unwanted columns and rows from the pivot
Or you can refer all required cells of this pivot sheet to new sheet. Only issue is you need keep clicking 'Refresh All' from Data Tab on the ribbon everytime there is a change.
Now all your data are in your master sheet
You can also do this using Microsoft Query option found in Data Tab-->From Other sources.
I'm working on a spreadsheet to act as a master copy for some important information that will be kept track of for a project. On the main sheet I have a table for notes and a table for contacts set up separated by several columns and some VB code to insert new notes or new contacts. However, when I insert a new note I want it to appear at the top of the table and to move all existing notes down a row. Is there any way to add a row to a specific set of columns so that any other data that is kept on cells with the same row, but in a different table, are not moved?
A basic example:
Dim rng As Range
Set rng = Worksheets("Sheet1").Range("A2:D2")
rng.Insert Shift:=xlDown
...assuming that you want to insert 1 row of cells above the cells currently located in A2:D2.
You'll have to code a VBA macro that selects all cells in the notes table as a Range object, and then moves them down one row.
I wouldn't know the exact code, but I'd advise you use the "Record Macro" function and do it by hand: select two cells in an Excel sheet, press the right mouse button and click "Insert". Then it'll ask you if you want to move the rows down. You can see in the newly recorded macro what the code is, and adjust it for your specific purpose. Good luck!