Excel checkbox, When clicking copy cells and past to new sheet - excel

I want to click a checkbox, and then it copys the two cells beside it. then it have to check on a new sheet if the to first colums on the first row is free. if they are then past, if they are not then check if the next row i free and so on.
Im not so skilled so a step by step guide would be nice.
sorry my poor english. and thanks
Greatings from
Jesper

Just to show a different non-vba approach:
Insert a "form control" checkbox for each line and connect it to a non used cell in that line (in my example column A)
Then simply get the values by formula (ive done it at 1 sheet, but te ranges simply can be changed)
=IFERROR(INDEX(C$1:C$16,SMALL(IF($A$1:$A$16=TRUE,ROW($A$1:$A$16)),ROW())),"")
This is an array formula and must be confirmed with ctrl + shift + enter!

Related

Excel filtering of merged cells - extension

I'm trying to filter an excel which contains merged cells. My data is laid out similar to the example below.
I found a similar answered question here. The answer to this question works well for my spreadsheet initially, however the spreadsheet I'm applying this to is a live document. If a new row is added later, this new row isn't recognised by the filter. The images below hopefully explain what I mean.
Filtering category 2:
Adding extra row:
Filtering after extra row is added - new row doesn't appear:
I believe this happens because when a new row is inserted, the category cell (in my example cell A6) is blank, rather than containing a value. When I unmerge the cells in column A I get this (A6 is blank):
I also tried copying an existing row and inserting it, hoping this would fill in the blank cell, but it had the same result.
Is there any more robust way of achieving a filter on the merged cells, which will accept new rows being added? I know a simple alternative would be to leave column A unmerged, however with the size of the spreadsheet this would look very messy. This spreadsheet is used by quite a few people and mostly edited using Excel online (on MS Teams) so macros aren't a desirable solution either. Any help would be greatly appreciated.
Try the following:
Select your unmerged range, click Home > Find & Select > Go To Special. In the Go To Special dialog box, select Blanks and click OK.
All blanks from your range are now selected and if you press Arrow Up one time followed by ctrl + enter
All the blank cels will now contain the value from the cell above.
I believe that solves your problem without VBA.

excel, filter on, shift column values to the left

I have a spreadsheet with a filter on. I need to shift column values to the left. Please see below screenshot.
In below screenshot, I want to delete Name1 - Name5 and shift all the cells on the right to the left. I can't do this. Excel will not let me. It wants me to delete the entire row which I do not want to do.
I also do not want to use the = next column formula since there are 50+ columns in this spreadsheet. So I need some help and advice.
I have tried to highlight the first Home to Address5 and drag that to the left, then get error message
The command you chose cannot be performed with multiple selections. Select a single range and click the command again.

Finding duplicates in different sheets or giving a message box if duplicate is found

I have tried several options already but can't get what I want.
I have a workbook of 31 sheets and each sheet has a column where number entries are entered. There can be duplicates in one sheet but there shouldn't be duplicates among different sheets. How should I do it?
So far I have come up with another sheet which takes all the values from other 31 using IF and with the help of a macro button removes duplicates in each column (for each sheet). There is a conditional formatting on top so it shows in that sheet whether duplicate was entered or not. However, it would be best if there would be a popup saying there is a duplicate.
In the sheet with all the entries I also have 0 and Empty values which will be in every column in every case.
Best solution would be to have a button which can be pressed whenever the check is needed.
Thanks for any suggestions!
Did i forget to mention that I am a total noob in terms of VBA? I do not think things that I tried are relevant. As I only need the code for the button to be placed in each sheet "Check" which would check the sheet with all the values and give a message if a duplicate is found, except for 0 and Empty.
You don't need VBA. Even though I am a software developer I try to use as little VBA as I can.
Lets say your values of all 31 sheets are on every sheet in A1-A10. Then do the following per sheet:
First create a column with the unique values of the sheet. For that you need a "matrix formula". Skip C1 and type the following formula in cell C2 and close with CTRL-SHIFT-ENTER (not just ENTER!):
=IFERROR(INDEX($A$1:$A$10, MATCH(0, IF(ISBLANK($A$1:$A$10),1,COUNTIF($C$1:C1, $A$1:$A$10)), 0)),"")
Now you get a matrix formula. As you can see there are now brackets {} around the formula.
Now fill the formula down to C11 and you get only the unique values of A1-A10. After you did this 31 times, reference all 31 columns C to an overview sheet.
You can see the duplicates in the overview sheet with conditional formatting. It is explained here. With this solution it will be very easy to pinpoint the duplicates.
But if you want to have values instead of formatting, create a second overview sheet and put this formula in A1:
=IF(ISNUMBER(OverviewSheet!A1),IF(OverviewSheet!A1<>0,COUNTIF(OverviewSheet!$A$1:$AE$10,OverviewSheet!A1)>1))
and fill this formula to cell AE10. You will get a whole range of TRUE/FALSE. This formula also takes empty cell and zeros into account.
Now place this formula somewhere on the second overview sheet:
=COUNTIF(A1:AE10,TRUE())>0
Now you have one cell that contains only TRUE or FALSE if you have duplicates over your 31 sheets.
If you want this result under a button I am convinced you will be able to create a macro for this.
Maybe there are shorter results, but this is what I came up with.
Success!
EDIT:
OK, maybe I was too positive about VBA. Let's say the last formula is in AF1, then this is your macro:
Sub Check()
If ThisWorkbook.Sheets("OverviewSheet2").Range("AF1").Value = True Then
MsgBox "We have duplicates!"
Else
MsgBox "We have no duplicates."
End If
End Sub
Now the most simple option for this macro is to put in under a shortcut-key (View -> Macros -> View Macros -> Select 'Check' macro -> Options... -> Shortcut key), e.g. CTRL-SHIFT-D. Then you don't need 31 buttons on every sheet.

Adding same drop-down value to multiple cells simultaneously

I was wondering how to add the same drop-down value (e.g. Yes or No) to multiple cells in the column at the same time? I tried selecting individual cells that I need to fill with the same value using Ctrl, and then selecting the value from the drop-down menu, but it only fills the single highlighted cell.
Is there a quick way to select cells and then add the same drop-down value simultaneously to all of them?
I'm using Excel 2013.
Thank you!
Place the drop-down in the top cell. Then select the block of cells (including the top cell) with either the ARROW keys or the mouse and touch Ctrl + d
i also found no answers for this online so came up with my own solution.
It is using macros but only a basic knowledge of how to record is needed so its very easy.
Once your drop down lists are set up, you would start with Sheet 1 and simply record a macro where you are copying the value you selected in sheet 1 and then pasting into sheet 2. then assign this macro to a button on sheet 1. every time you click the button, it will copy and paste the selected value in your sheet 1 drop down into sheet 2.
you would then do the same thing in sheet 2, except that you are copying the value into sheet 1.
you can do this for any number of sheets.
hth.
I tried it as follows and it worked:
Select a cell and select the value for it (yes or no for example). Then select the group of cells you wan to have that same value - include the original cells with the value (yes or no)as the top cell in the range. Hit ctrl and D and all the cells will fill with the value in the top cell.
I accomplished this task in Excel 2013 by doing the following:
Select the cell with the drop down response
Scroll down to the last cell in the row that you want to have the same answer
Press the shift key
Select the last cell in the row that you want to have the same response
Release shift key and scroll back up to the first cell that you highlighted
Select your response in that cell
Hit Ctrl+D (to duplicate response).
I'll try and explain a little more clearly for you.
Select, with your mouse, the top most cell in the column you want to make all YES, scroll down if you need to and then, before clicking anything hold the SHIFT (not CTRL) key while you click the bottom cell in the row you wish to update.
This should highlight all of the cells in the column from the first, to the last you clicked. Now, release the SHIFT key and select YES (or no) in the top cell. The top cell (only) will change to YES (or No if you selected that). Now, without clicking doing anything else, hold down CTRL and while holding it press D.
If done correctly, all of the highlighted cells will now match the top cell.

Conditional data entry on certain text in excel

I'm after some pointers.
I want to input text into some cells based on the contents of others.
Current formula that I'm using in cell B1 is
=IF(ISERROR(FIND("example",A1)),"no","yes")
So far, so simple. This works. Inputs 'yes' in B1 if 'example' is located in the cell A1, copy down.
However, there are some cells in the B column which have already been formatted with other text in, and I want to apply this formula on the entire spreadsheet without removing the existing text in column B. So far, the only thing I can think of is by putting this formula in the C column, copying down then moving the text from the C column to the B column - but this requires laborious copy and pasting that kind of negates the time saving provided by the formula.
What is the best way to achieve this? Do I need to resort to VB to scan the entire sheet, iterating through A1-A30000 and inserting the requisite text in B column?
Cheers.
Edit:
So, this has been pretty much sorted, with a variety of suggestions.
However, the actual formula I'm using is:
=IF(ISERROR(FIND("example",A1)),"","yes")
as I only want text to be put in columnB if the pattern is found. This has presented another problem! The double quotes signifying no replacement if the pattern ISN'T found actually inserts a 'NULL' character in there; when you try and select the blank cells on the next iteration of the operation, no cells are selected, as even though there is no visible character, Excel thinks there is. xD
This is solved by writing a macro function to remove Null characters.
Excel is infuriating sometimes. :P
All of the information and advice already given is definitely correct and gets the job done,
byt thought I'd add one that does not require ANY changes to the existing data (eg sorting or filtering):
Put your formula as you described is cell B1. Apply any conditional formatting to that cell, as required.
Now select and copy (ctrl+C) cell B1. Select column B (click on column heading).
Then Click find and Select (binoculars icon) - on Home ribbon tab. Choose go to Special.
In the popup choose Blanks and click ok. You will note all blank cells in colum B are selected. Don’t click anything, press Crtl-V.
Voilà, your formula and conditional formatting is pasted into all blank cells, leaving the rest alone.
Quick keyboard sequence:
select B1
Press ‘Ctrl + C’
Ctrl + ‘Space Bar’
Press ‘Ctrl + G’
Press Tab twice to go to ‘Special…’ button, press Enter
Press ‘K’ for blanks, Press Enter
Press ‘Ctrl + V’
(optional) press escape to remove selection from B1
There are a few ways to deal with this. I'll explain 2 of them :
If sorting is an option, sort your table by column B (ascending / A-Z) to get all the empty values at the top. Write your formula in the first blank cell and extend it by double-clicking the bottom-right corner of that cell.
If you cannot sort, apply filters to the table and select only the blank cells in column B. Then write the formula in the first blank cell and extend it by dragging it down to the last cell.
You might combine your existing B column values with those to be added conditionally in a single formula, say in ColumnC, such as:
=IF(ISBLANK(B1),IF(ISERROR(FIND("example",A1)),"no","yes"),B1)
copied down to suit. Then if ColumnB has become redundant, copy ColumnC, Paste Special, Values over the top and delete ColumnB. The result is to convert the formulae to the results thereof, that may increase processing speed but reduce the ease of handling additional rows (if any) subject to the same requirements.

Resources