AutoFilter - User Can Choose Range And Input From / To Date

Mar 19, 2012

I have a work book.

In column C27 and down, the user can input a date.
In column M27 down, the user chooses pass or fail.

N8, contains a date chosen by user as the "From" date and P8 the "to" date.

Cell o11 is "Passed" and cell 012 is "failed"

The user can choose a date range and input the from and to date in N8 and P8, this will count the number of pass and fails and input the number in O11 and o12.

Formulas are below.

Code:
=COUNTIFS('Aff MFR'!C27:C1663,">="&'Aff MFR'!N8,'Aff MFR'!C27:C1663,"="&'Aff MFR'!N8,'Aff MFR'!C27:C1663,"

View 1 Replies


ADVERTISEMENT

Fill Date Across Columns Based On User Date Range Input?

Mar 5, 2014

based on user date ranges entered on sheet1, I'm trying to write code that will write each month of the date range on other sheets across the 2nd row. at this point I'm getting "object required" error at "Set DateStart = Cells(2, 6)"

I also want the date format to be mmm-yy (Mar 14) on the sheets even if sheet1 has a different format. I tried using sourcerange instead of DateStart, but that didnt work either.

Code:

Dim projStartDate As Date
Dim projEndDate As Date
Dim DateStart As Date[code]....

View 1 Replies View Related

Let User Choose Column Range

Aug 28, 2007

I 'm trying to do one macros where the user has to choose the column where he wants to work, to avoid the user start counting the number of the letter that corresponds in the alphabet, I would like to make it easer, because working with column numbers when programming is easier, but in terms of user is easier to work with letters

View 8 Replies View Related

Allow User To Choose Range For Chart

Apr 29, 2008

I want to make a chart with the time in x axis and all of the S in the y axis. The problem is I want to be able to choose which S that I want to put in the chart. Example, I want to make 2 chart with S2,S3 and S5 in the first chart and S1 and S6 in the second chart. What I want is when I click the button 'chart', a pop-up appear and ask which S that I want to include in the chart.

View 7 Replies View Related

Check A User Input To See If The User Has Entered The Date Correctly

Feb 17, 2010

I am trying to check a user input to see if the user has entered the date correctly. I am using the code below but it keeps giving me a "Type Mismatch" error.

View 2 Replies View Related

Using An Input Date In An Autofilter

Aug 3, 2007

I need to have users input a date range for a report and then use that to autofilter a query from a database.

I think I have it close, but I can't tell what I'm missing. I can see the InputBox dates if I put them into a cell. And the criteria operators come up correct in the Autofilter, but the value shows as Starting and Ending, so it's filtering out everything.

View 10 Replies View Related

User Input Date Not Kept In Date Format

Mar 29, 2014

My macro asks for a user input in DD-MM-YY format (which is the same format of all cells in the Excel worksheet).

I then instruct the macro to paste the string into cell A1 in 'TEST' sheet.

However when it pastes in the format is MM-DD-YY with the user input DD being the worksheet MM etc.

For example 06-04-14 becomes 04-06-14.

My code is below:

[Code] ......

Attached File : TEST.xlsm‎

View 2 Replies View Related

User Input Into A Range

Jul 14, 2006

This code works fine if i use static ranges, but i would like the user to input the column in which the data is stored.

'Get data for the locations of the gaming license numbers needed for the comparison
varPlayerHost = InputBox("Please enter a single letter for the" + vbCrLf + _
"Column that the Player Host License" + vbCrLf + _
"numbers are in.", "Player Host Number Location", "H")
varHostLicense = InputBox("Now enter the column letter for the copied employee" + vbCrLf + _
"license numbers", "Employee License Number Location", "U")

'Set the ranges for the data to be compared
'This is where I am getting the error???
Set rRangeA = Range([varPlayerHost,1], Range(varPlayerHost, 65536).End(xlUp))
Set rRangeB = Range([varHostLicense,1], Range(varHostLicense, 65536).End(xlUp))

'The actual comparison and deletion of record that match the license numbers copied.
'When this function finishes you will be left with a spreadsheet that only has patron
'information left for the patrons that have an invalid host number.
For Each rCell In rRangeA
If WorksheetFunction. CountIf(rRangeB, rCell) > 0 Then
rCell.EntireRow.Delete
End If
Next rCell

This exact code is kicking an error
"Run Time error 1004"
"Method 'Range' of Object '_Global' failed"
Not quite sure where i went wrong.

View 9 Replies View Related

VBA Script In Excel To Prompt User To Input Date?

Sep 15, 2014

I have a cell (C16) that has a date format (such as 08/28/2014). I want the value of this cell to be "N/A" when cell C7 is "No". When C7 is "Yes", I want Excel to prompt the user to enter a date for C16 when they click on C16. The formula for cell C7 is =IF(C3="No","No","Yes"). That's where the value of C7="No" comes from. If I didn't need a date for the value of C16, the formula would be something like =IF(C7="No","N/A","______"). I have just recently started trying Excel macros due to a tool

View 9 Replies View Related

User Select Range Through Input Box

Sep 21, 2009

I'm trying to get a users' selected range to display in a cell as stored text.

therefore, If a user selects A1:D7. The text in Cells("G", 10) will be:"A1:D7"

w/o the quotes.

I've attached an example workbook.
Here's the formula thus far:

Sub SelectRangeBox()
Dim rnBody As Range
Dim vaMsg As Variant
Do
vaMsg = Application.InputBox( _
Prompt:="Please enter the message-text:", _
Title:="Message", _
Type:=2)
Loop While vaMsg = ""................................

Actuall maybe my thread should be Titled. user selected cell range displayed in input box save to cell as a text value.

View 2 Replies View Related

Color Range With User Input

Mar 8, 2007

I have searched for code in the forum to help me here but could not get any of the possible choices to work for me. I have a spreadsheet that is password protected but would like the user to be able to change the color of the fonts based on the user's choice. The protected page (one of many in the spreadsheet) has various cells that are unlocked so that the user can enter data. The rest of the page is locked. I have allowed all users of the worksheet to Select Unlocked Cells only. I have attempted to allow them to Format cells as well, but each time the program is re opened this feature is no longer working. (The program has a macro that ensures it opens in protected mode each time.)

So I would like to set up a Macro that allows the users to set the color of 6 rows and 5 columns based on their choice. An example of the configuration is:
1234Color Choice

A11016221
B21117232
C31218243
D41319254
E51420265
F61521276

Using the above format, I am imagining the I would have a Key with color codes (using the ColorIndex Properties). The user would type in the appropriate number for each row and click a button and the rows (5 cells each) would change to the selected color.

View 9 Replies View Related

Excel 2007 :: Choose Date From A Range Of Dates In Column On Sheet

Feb 6, 2012

Excel 2007 Q: I have a combo box (ActivX) that I want to be able to choose a a date from a range of dates in column A on sheet 'Working Copy'. I want a cell to update with the number/position of the date when the date is chosen i.e. the first date in the range yields 1 the second date yields 2 and so on. I also want the date to be displayed in dd-mmm-yyyy format. I am able to get the cell to give the correct position of the date but the date reverts to five digit number in combo box. I can change the code to return the correct date in the combo box when the date is chosen but then the cell just returns 0.

How can I make it so that the combo box returns the correct date and the cell updates with the position instead of jsut one or the other?

Here is the code I am using

Private Sub ComboBox1_Change()
ComboBox1.Value = Format(ComboBox1.Text, "dd-mmm-yyyy")
End Sub
or
Private Sub ComboBox1_Change()
Sheets("Working Copy").Range("G1").Value = ComboBox1.ListIndex + 1
End Sub

View 1 Replies View Related

User Input To Set Last Column In Range To Copy

Apr 9, 2009

If possible could someone please help with changing the below code so that column "D" in the rngIn part of the code can be a variable. i.e so the user can select one, two, three or four columns (with visible data) to be copied. The "b3" part is a constant.

View 14 Replies View Related

Sum A Range Of Cells Based On User Input

May 2, 2009

I have a range of cells that I want to sum based on a range inputed by the user. The range begins with cell c27 and ends with cell au27. I want the user to be asked the beginning cell and ending cell of the range they want to sum and then output the answer.

View 4 Replies View Related

Randomly Choose Sample Rows After Using Autofilter

Nov 5, 2009

Can anyone explain clearly (using layman terms) about how to go about randomly choosing specific number of rows from a set of autofiltered records?

For e.g., If there are 1000 rows of data in a worksheet and after applying autofilter to certain column(s) [one or more] say i get some 75 rows. Then how can x no. of rows be chosen where x can be input by the user or calculated based on a certain percentage? Say if out of these 75 filtered rows, 8 rows have to be chosen randomly - where 8 can be input by the user or also be calculated as 10% of 75.

Also, is it possible to choose these x records from the filtered set of rows without actually copying them to another sheet?

View 12 Replies View Related

Userform To Display Range And Populate User Input

Jan 9, 2013

I have a few questions here.

1) Can a userform procedure be place in the midst a larger macro, so that it can get input from the user before running the rest of the macro? ie If the user leave the input field blank, the macro will exit will a msgbox.

2) I have a range(A1:A3) that i want my userform to display. This range is dynamic. The user will require to input the corresponding country next to it. how do i code the this? I will need to use a listboxes and textboxes right?

for example: userform shows city on the left, user will need to input the country on the right.

A1 - California (user input on the right)
A2 - Shanghai (user input on the right)
A3 - Mumbai (user input on the right)

View 1 Replies View Related

Copy Formula Across Based On User-defined Input Range

Apr 4, 2008

I have a cell B10 which contains a formula.

I would like a macro which copies this formula across the same row.

However, the macro should prompt the user to select a range.

Based on the range selected and in particular the columns in this selected range, I would like the macro to copy the formula only for the columns specified in the selected range.

View 9 Replies View Related

Compare Date: Compare The Date From The User Input And The Date Listed

Jan 18, 2007

I need to compare the date from the user input and the date listed on excel. How can I compare it? Is it correct? lngCmp = Val( Cells(I, 31))

Dim lngBegin As Long, lngEnd As Long, lngCmp As Date, lngResults As Long
lngBegin = 9 'beggining of data
lngEnd = 232 'end of data
lngCmp = InputBox("Please enter the date", "Begining of the week")

Lngcmp1 = DateAdd("d", 1, lngCmp)
lngCmp2 = DateAdd("d", 2, lngCmp)
lngCmp3 = DateAdd("d", 3, lngCmp)
lngCmp4 = DateAdd("d", 4, lngCmp)
lngCmp5 = DateAdd("d", 5, lngCmp)

'lngCmp1 = lngCmp + 1
'lngCmp2 = lngCmp + 2
'lngCmp3 = lngCmp + 3
'lngCmp4 = lngCmp + 4
'lngCmp5 = lngCmp + 5
lngResults = 0
lngResults1 = 0
lngResults2 = 0..................................

View 2 Replies View Related

Allow User To Choose Dates To Chart

Sep 12, 2006

selecting dates and data and makinga graph

and thought I could learn this one myself. I was wrong. Andy Pope came up with a nice little spreadsheet but I could not follow it (being a novice).

The problem is, I want the user to be able to input a start date and an end date and a graph to update automatically between these dates (for the x-axis) but also the y data adjust to suit.

The input cells are C23 and C30, and the 5 Y-axis data are the coloured columns.

I have attached a zip file with the excel spreadsheet inside.

View 4 Replies View Related

Allow User To Choose File To Open

Oct 19, 2006

We have several salespeople who maintain a workbook tracking their workflow. I want to compile the customer account number, account name and deal number for each rep to another workbook. A new sourcebook is started each week. This code is in the target book

'Option Explicit

Public sourcebook As Object 'the workflow workbook

Sub GETDATA()

Dim wsc As Double 'the number of pages in the workflow

Dim col As Long 'the column in this workbook for returning values

Dim IntEndRow As Double 'the end row in this book

Dim SrcEndRow As Double 'the end row in workflow

Dim findval 'the column workflow where the sourcedata is found

My code allows the user to select a workbook and then loops through each sheet in that book searching for the column which has the info I need, this changes on each sheet as the reps each deal with different types of customer as so take different details. I solved this by having column headers in the target book and searching for them in the sourcebook.

This code works when I step through it but falls over at the "Set sourcebook" line when I run it where it returns a breakpoint error.

View 3 Replies View Related

Allow User To Choose From List Of Open Windows?

Mar 27, 2009

I have a few macros that need to work with various worksheets which are in different windows.

1. Make the user name the files a certain way for consistency
2. Make the user type the name of each window at the start of execution

I was wondering if there was a more flexible option though: one which would allow the user to choose from a list of open windows (similar to the Window>More Windows>Activate function in Excel).

Ideally the macro would run and say something like, "Which of the following open windows contains dataset1?" "Which of the following open windows contains dataset2?"

View 2 Replies View Related

Display File Open For User To Choose

May 24, 2009

I have code (below) that works if the range "ImportFile2" contains a valid value but I want users to be able to select any .csv file preferably from a directory which should be held in a cell.

I added ...

View 9 Replies View Related

Get User To Choose Location Of Linked Data

Sep 18, 2006

I've have a spreadsheet where 4 cells are linked to another workbook via a vlookup.
the problem i have is that a lot of users can update this external book, or it can be saved as a seperate spreadsheet somewhere else on the network. If it was up2 me i would have them only update the one sheet, but as it stands its not. So what i want to be able to do is put some code onto a button on the sheet, from here i want the: Application. GetOpenFileName

method to open....but from here i want them to be able to pick the cells where the data is situated. Any clues..... i can get as far as them selecting a workbook. Do you think i will need to create another userform?? Maybe RefEdit? I'm not sure.

View 3 Replies View Related

Force User To Choose From 2 Drop-Downs

Dec 29, 2006

I have two columns, Account Number and Account Type. I already use Data Validation on Account Number to make sure it is numeric and on Account Type to make sure the user picks from a drop-down list. I want it so that if a user inputs an account number, it forces the user to automatically pick from the drop-down menu in the account type column, otherwise post an error.

View 3 Replies View Related

User To Choose Multiple Files To Open

Mar 26, 2008

I have a control button that uses this code

ChDir "H:EMCARCHIVE"
varFileName = Application. GetOpenFilename("Excel Files (*.csv), *.csv, (*.xls), *.xls")

however the files list but when you select any one of them they do not open and the file name is not displayed in the filename box

can you let me know why the files do not open

View 4 Replies View Related

Allow User To Choose Folder/File To Open

Apr 18, 2008

I am trying to open a folder so I may choose the workbook to open. I am able to open a workbook but I want to open the folder which contains the workbook.

View 6 Replies View Related

Userform - Date Range To Control Autofilter

Jan 10, 2012

creating 2 fields in my userform that the user can input 2 dates that would serve as the range to set the autofilter. So user inputs field1 = 11/01/2011 and then field2 = 01/31/2012.

I was previously using a month range in my userform, populating from the known months and allowing the user to select a range. Since our data is now spanning a new year, this is no longer possible as I cannot make the combobox range go from 11 - 1 (November to January)

VBA Userform - select months & Months between - Code Included

View 1 Replies View Related

Determining Formula To Choose And How To Input The Data In Correct Fields

Aug 8, 2014

I am trying to save some time converting a cut up inventory catalog number. Specifically focusing on the color code. I have the list of colors associated with their specific part number. The order cannot change or my sheet will mismatch.

What I want to do is convert the # in column A to the color code text in column b so that it matches the translated code in column C? For example

1 I want to tell 1 to = Polished Chrome anytime #1 appears in my column.

What formula should I choose to achieve that goal. As well, how do I know what data to imput into the formula wizard?

Sheet is attached.

I have Cut a few thousand items off the bottom of the sheet. I can apply to additional data left off.

View 4 Replies View Related

Make A List Of Selections For User To Choose From In My Combo Box?

Jan 8, 2008

How do I make a list of selections for user to choose from in my combo box?

View 9 Replies View Related

Macro: Allow User To Choose Workbook/File To Open

Sep 8, 2006

I am making a macro that requires that user to enter a directory path into a input box and the macro will open the file. Right now it works fine bit i would like to change the code so that instead of using an input box it brings up a box that will allow them to browse files on their computer and then select one to open.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved