Create a user form in Excel that uses formulas - excel

I have a simple excel file containing 2 tabs (Sheet1 and Sheet 2). Sheet 1 contains a list with multiple columns: file number (A), name (B), address(C), first_call (D), date/time of first call (E), second call (F), date/time of second call (G). Sheet2 is basically a form containing the same fields, built as follows:
A1 - file number (entered manually)
A2 - uses VLOOKUP to display name associated with the file number on A1
A3 - uses VLOOKUP to display address associated with the file number on A1
A4 - drop down list containing several items (for instance, wrong number, not interested etc.)
A5 - time stamp, based on value in A4 (if an option is selected, A5 will show the date and time of selection and cannot be modified)
A6 - same as A4
A7 - same as A5
(In reality, the list is much larger, with more columns)
Now, admitting I enter a file number in A1. Information in A2 and A3 will be automatically displayed. I then select the result of the first phone call in A4. I want that selection (and the corresponding time stamp) to be carried to Sheet1, column D in the same line as the file number. This information should be permanent (like, if I enter the same file number again in Sheet2!A1, cell A4 should display the information previously entered). My only option at this point is to make another selection in Sheet2!A6.
I know how to create a user form, but the problem is that almost every cell in Sheet1 contains a formula. As a result, a simple user form is not an option.
Basically, I want my "form" in Sheet2 to be able to read from Sheet 1 or write to Sheet1 if the cell is blank. It's a 2-way form. If a cell in the list contains data, it will be displayed (read only). If not, it lets you update it.
I have also tried to use a 3rd sheet to kind of create a loop but it doesn't work.
I don't want somebody to do the work for me. I just want to know if this can be done with formulas (since my VBA knowledge is very, I mean very limited). Any help in this matter is greatly appreciated!

Related

Assign values to name in excel

How can I assign a value to a name in excel that i could easily fill out same value to a name but in a different sheet. I know I could do in in python with openxlm lib but as it is my computer from work I can't install anything, even python. My database is very long and I have more than 10 sheets to fill out. Names doesn't appear in every sheets therefore i can't just copy and paste whole column with values
.
This is really quite easy: I have created two sheets ("Sheet1" and "Sheet2"), I filled both sheets as you have shown, and in the "VALUE" column of "Sheet2" (D2, I mean), I have filled in following formula:
=VLookup(A2;Sheet1!$A$1:$D$6;4;FALSE)
Some explanation:
A2 stands for the first entry, which is searched (by this I mean "John", the first entry in the "Name" column in "Sheet2").
Sheet1!$A$1:$D$6 is the table, where I am searching in. It is crucial to use the dollar-signs, as, when you drag your formula down, the first reference will change (A2 will be come A3, A4, ..., but $A$1:$D$6 will not, you will always continue searching in the same table).
4 means that the fourth column of the searched table will be shown (the "VALUE" column in "Sheet1").
FALSE means: do not use approximative search, but use exact one.
Now you can drag that formula down, until the end of your "Sheet2".

Can I use a =CELL("address" as a reference to define where VBA writes for me?

I am trying to create a button on a worksheet which will input today's date in the first empty cell in a row which is designated by a drop down list.
I have the dropdown set up.
I have a column (C) which designates the address of the first empty cell in each row. C11 reads $J$11, C12 reads $K$12, C13 reads $J$13.
I have a seperate cell (B2) that just references which input cell, based on what the dropdown list is currently set on.
B1=employee name (Referencing the drop down on another sheet)
B2=INDEX(C4:C100,MATCH($B$1,DatabaseTable[[#All],[Combined Name]],0)) (This finds the row, in this case, 12 and repeats the data in column C.)
C12=CELL("address",INDEX(DatabaseTable[#],0,B12)) (This outputs the the next cell address to write in this row.)
B12=MATCH(TRUE,INDEX(ISBLANK(DatabaseTable[#]),0),0) (This tells me which column contains the first blank in the row.)
So, the specific question I have (unless someone can tell me a smarter way) is, how do I tell VBA to select the cell address from B2 (Which currently reads $k$12, but can change to anything, based on the drop down), and then write today's date in that cell? (I can figure out the writing part, just need to know how to select a cell based on the cell address output)
Thanks in advance for any guidance anyone can offer!

Linking entered dates to column location

I have a spreadsheet with the following format. I was given this spreadsheet to use so I'm not sure what use these formulas for dates have in opposition to normal text.
Along the first 4 rows of each column:
K2: 2017 [=TEXT(K$5,"yyyy")]
K3: April[=TEXT(K$5,"mmmm")]
K4: Wed [=TEXT(K$5,"ddd")]
K5: 05 [=J5+1]
In another sheet, I want to do:
=Sum(K6:N6)
=Sum(K7:N7)
At the start of every week I have to change the columns to the dates of that week
=Sum(O6:S6)
=Sum(O7:S7)
Instead of manually entering the range of columns each week for the 40 rows that I have, Is there a way I can type in the date, or the column in a separate cell and use that as the object of the formula so I only have to enter a start column and end column/or date and the list will all update?
Not sure about the whole picture, but the answer to your question is yes, you can have a special cell (or several cells) where you can keep some parameters.
In order to use the value from such cell in a formula you have to specify it with the "$" characters, this way the address of the cell will not change when you copy/move the formulas around.
So, say, you want the parameter to be in cell A2 - in the formulas you have to use "$A$2".
Another way is to use named ranges. You can assign a name to a cell or range of cells. THe simplest way to do so is to select the cell you want to hold the parameter (let's say it's A2 again) and then click into the box leftmost to the formula bar (where A2 is displayed) and type there a name you'd like to use, for example "STARTDATE" and press Enter. You have just named your cell. Now in a formula you can use STARTDATE instead of cell address, which is even better, because you can use a meaningful name and the formulas will be easier to understand.

Can Excel save values in a linked list/store values and allow the original place to be deleted?

Is there a way to be able to input a value in an Excel cell and have it be stored into another cell on another workbook/worksheet?
I am wanting to enter a value in, lets say, A1 and have it be stored in B1 on the second workbook but then when A1 is edited with another value the new value is placed in cell B2 and the next in B3 and so on.
Is this possible?
I used a linked list as an example because I am more familiar with C# and such but not incredible with Excel or it's abilities.
Thank you all for reading.
-Colt

Excel Lookup and pull in depending on cell contents

Another tricky issue for me.
I have worksheet with all my information. On another sheet I need to pull a number depending on a specific value. for example:
On the Master sheet,
Cell AN2 will contain either BMI or ASCAP
Cell A2 will contain a number, let's say 12345
On my Second sheet, I have two columns; AJ2 for BMI# and AM2 for the ASCAP#
I need to look at the Master sheet, decide if A2 is a BMI or ASCAP number (from AN2) and put it in the correct cell on the Second sheet.
I know this is a Vlookup function, but I can't get it to work. I did a search and read through some of the answers, but still can't get it to work.
Thanks for all the great info here.
Using Excel 15 on MacOS
I think if you put this formula into your second sheet in AJ2:
=IF(Master!AN2="BMI",Master!A2,"")
And this in AN2:
=IF(Master!AN2="ASCAP",Master!A2,"")
And copy those values down, it should work. This will, of course, only populate one of the two for any given row, but based on your description it sounds like that's what you wanted.
And of course if your sheet isn't literally named "Master," change it to whatever the sheet name actually is.

Resources