Macro To Move From One Sheet To Another Based On Responses
Sep 20, 2006
I have a spreadsheet in which the user will respond to questions using "T" for "True" or "F" for "False". If there is a certain number of T's I would like the macro to take the user to one sheet in the workbook or if there are a certain number of F's I'd like it to take the user to another sheet in the workbook.
I have had several intro programming classes, but not with visual basic. I've noted the problem lines with comments below. The problems are probably very easy syntax error.
Sub list()
Dim counter As Integer Dim counter2 As Integer Dim id As Double Dim id2 As Double Dim palletnum As Integer
I've created the form and formatted everythig as I need it but now I am clueless how to make the command button (enter data) post the data to the appropriate cells in my spreadsheet. I especially need the data to find the first empty row so that it doesn't overwrite the previously entered information.
how to create a progress meter based on yes/no (completed/not completed) responses? If 2/10 responses are completed, then the progress meter would display 20% or 20% of the bar would be red. Is this even possible in excel? I've used conditional formatting to create a progress meter but can't figure out how to make a progress bar based on responses.
I would like to generate a dynamic list of the top five most common text responses in a range. For simplicity sake, let's assume that the range spans cells A1 to A20, and the list is generated in cells B1 to B5. So, essentially, I am seeking five separate formulas. One to calculate the most common text element, one to calculate the second most common text element, one to calculate the third most common text element and so forth.
I am currently working with the two formulas below but finding it incredibly difficult to merge them into a working format.
Formula for finding second most common number: =MODE(IF(IF(A1:A20"",A1:A20)MODE(IF(A1:A20"",A1:A20) ),IF(A1:A20"",A1:A20),""))
Formula for finding most common text element: =INDEX(A1:A20,MODE(IF(ISTEXT(A1:A20 ),MATCH(A1:A20,A1:A20,0))))
I have a large document with a lot of names listed. I want to make up new sheets for each person listed. Is there a formula that I can enter that will move the entire row based on the person's name? See attached.
I need write a VBA code that will move an entire row into a new sheet if the value of the last cell says "YES" If the value is blank then Id like it to stay in the current sheet. I would also like it if the cell wont allow any other value other than Yes to be typed.
I found this code here:
Copy, Move and Delete Row, based on Cell Value
THE VERY FIRST CODE REPLIED IN THAT THREAD.
I just cannot seem to get it to work. Simply copying and pasting that into the module doesn't work. I am not very good at VBA and just started taking a course on VBA. Id like to jump into this problem asap as I need it for work.
Basically:
Columns A:E will have values. In Column E I would like to type in Yes if completed. I would like the Macro to run through all of Column E and if the cell value is "YES" then I want it to cut the entire row and paste into a new sheet. In the new sheet I would like it to be pasted into the next available row.
Also can I create this with a ActiveX control button? I would like to have a button that I can click at the end of my work which will run the Macro in sheet 1.
I want to do is copy all rows from the worksheet DATA based on column G (Date) and copy it to a new sheet based on the date (all 2003 on the 2003 sheet and all 2004 on 2004 sheet.....).
I have already created the new sheets including headers minus data. I would like to have all the data moved except the last to Columns AW & AX. I have two hidden sheets in this workbook. Would it be possible to have it auto-populate future entries from the "DATA" worksheet to autofill onto the new sheets?
Just noticed that I titled the Thread with Move but what I am asking for is copy. I cannot change the Thread title.
I am trying to move info from an unformatted sheet to a sheet ready to import into a program. I need to look at the source sheet and if a column heading matches the heading on the destination sheet I need it to move the entire column to the destination sheet.
My data is in sheet 1 (Not yet printed). I would like to move automatically entiry rows (sometimes more then one) to sheet 2 (Printed) based on one cell's value. Here is a screenshot:
For example when I enter into Sheet 2 '264450' then row 2 would have been moved to Sheet 2.
And also with multiple rows, if I enter '264461' then row 4 and row 6 would have been moved to sheet 2 as well. I wouldn't like to enter a value more than once.
I have two sheets and need information from Sheet titled Add-Del_chng positions to be moved to the sheet titled Cost Distribution.The issues here are :
1. The values in Cells A through J should be moved only if col Z value is 'hard coded"
2. The values should be moved to the 13th row.
3. This should happen every time the value is input into col Z of sheet titled add_del_chng.
Currently the macro does not run unless I go into the code and press play. I need this to happen automatically.
I am attempting to write a macro so that when a user selects enters a particular selection in a cell, it will automatically move the entire row down to the last row and shade it in a different colour.
I have a excel file to keep track of sales pipeline. What I am looking for, is an automated utility or code that will allow excel to automatically move entire rows once a task is completed and can be moved to another sheet. In Prospect sheet I have a column for " sales stage" and here you have to select from a drop down menu, either "Prospect", "semi-qualifed" "Pre-qualified" "verbal" "closed-won" and Lost. What I would like, is that once you have selected one of the sales stage, the entire row or entry, will be automatically moved to a new sheet according to each stage.
I have a worksheet that has time clock information. I also have a resource on the web to see some information and even export it. In the exported data it looks as follows:
A1 contains an individuals name B1 says times i.e. "8am to 5pm"
I would like a macro that takes the data from A1 and moves it to another worksheet in the B4 position down, and take the times from B1 and move the first time to the C4 position and the last time to H4.
I would like a simple macro that would actually move a cell based on criteria. In my case it would be: In row A, if a cell starts with 'Agent Name' then that cell needs to move down one cell replacing the contents of that cell.
Basically I want to copy and paste all data in a row if the value in a cell is equal to something
I am currently using the below formula
The Value in red = Set tgt = ThisWorkbook.Sheets(Criterion.Offset(, 1).Value 'Pick the cell next to the cell containing the criterion).
But my issue is now that i will need this to work based on 37 values and having this macro 37 times with the value changed and 37 buttons will be difficult.
So I am looking for a way i can add multiple values each going to separate sheets.
Ok so Im working on Christmas functions and this is how my data base looks
Date Name Address Seats Price Total
1/12/2013 James Fran 1 Bold street 4 £20 £80
[Code] ......
What I need to do is move all the dates onto their own worksheet, so every row containing 1/12/2013 would move to the worksheet 1.12.13, the 6/12/2013 would move to the worksheet 6.12.13 and so on.
Currently I have to copy and paste each row manually, which takes time. Any macro or formula which would do this automatically every time new data is entered. The main database, like above, will contain around 200 entries.
I have a row of dates in row 2 (all sequential, from Nov through to June next year)
I have a row of number entries in row 3 (to correspond with the date in row 2 it was entered on).
I want to be able to add a new entry (a number) into a text box, click a macro button, which makes the text box input be moved into the cell underneath todays date (so every day the cell will move one column along)
I've managed to make myself a textbox, and a macro button, but I'm stuck with how to make it all work.
I have created a form where people will take a survey, and the responses from that survey will be carried over to another worksheet that will analyze their results.
For each question in the survey, I want them to choose only 1 of 2 responses. For example:
Place and X next to the statement that describes your opinion most often: __ I prefer to work with others. __ I prefer to work alone.
The responder will choose either the first or second response, but I do not know how to limit it so they can't answer both. I want a way to limit the worksheet so if they type an X in the first field, they are unable to type one in the second field, and vice versa.
Is there any way to limit the responders ability so that if they choose to respond to the first statement, they are not able to also respond with the second statement, and vice versa, while not affecting the results page that uses the IF formula =IF(sheet1!A8="X","X","")
I need a Macro which pulls the data from different sheets of excel (which is not formatted properly) to Main Sheet. Also some of the columns will not have the same names, so macro should handle this exception as well.
Sheet 2, Row 1 column B-E contain restraurant names (only on the top row, like field names).. i.e. I manually put the date in because typically the projected date is different from the actual review date.
-A----------- B ----------------C ------D-------- E----- Date |Ruby Tuesdays|Olive Garden|TGIF|Ruths Chris|
I need the data from Sheet 1 Column B moved to sheet 2 in the next open row (i currently have data in row 1..the field names and down to row 35). This will be continuous so each time i need it to add the score as a new row in the correct field (restaurant name), IF the restaurant isnt listed, I want a new field named with the restaurant name and then place the score in the correct row and column. So, in the example I'd need Outback added.
I am working on a project and would like to see if there is a solution for it. i have a workbook that has data entry that is summarized at a master level but I need to automatically use a formula to update another sheet after clicking an udpate button. The data from the data entry sheet needs to be allocated to all the lines that has the same master item based on the formula. A test workbook is attached ...
I have an automatic macro that runs from every sheet but is only based on one sheet. I had to protect the worksheet and in order to make the macro work I had to add an unlock and a lock code. The problem now is every time a user enters something it looks back to the other sheet and then comes back. Is there a way to prevent the user from seeing this. See code below
Private Sub Worksheet_Calculate() Sheets("Profit Calc Local Currency").Unprotect Password:="hspricing1" Application.EnableEvents = False Dim lr As Long lr = Cells(Rows.Count, "XEA").End(xlUp).Row Range("$XEA$1:$XEA$" & lr).AutoFilter Field:=1, Criteria1:="1" Sheets("Profit Calc Local Currency").Protect Password:="hspricing1" Application.EnableEvents = True End Sub
I have recorded the data from 12 records (i actually have hundreds, but im just using a small sample). Each record is represented by a vertical column. I want to find the total number of "x's" for only the records from Country1 (from all the answers). Then I want to find the number of "x's" from only Country2. I have tried the "countifs" function but cannot find a way to make it work. Would a different array function be better? How would I write it?
P.S. The answer for Country1 should be: 15. The answer for Country2 should be: 5.