i need to have this information entered in the row below each time which may or maynot be empty. i need a message box with error handling to ask if the user wants to enter more products or finish and another message box if the entries (which start at cell B4) go past B10 that they have to exit and start a new sheet. I have put the code below and attached the workbook so it may be of use to others
Option Explicit
Sub Locate(Name As String, Data As Range)
Dim rngFind As Range
Dim strFirstFind As String
With Data
Set rngFind = .Find(Name, LookIn:=xlValues, lookat:=xlPart)
If Not rngFind Is Nothing Then
strFirstFind = rngFind.Address
Do
If rngFind.Row > 1 Then
ListBox1.AddItem rngFind.Value
End If....................
Right now in my code I'm using the below section to determine the column in which to search for dupes, and the last column of data for that range. However, I make the user select only part or one column through IF statements above, so there's no need for the user to input this information. I'd like to replace the choice part with and automated routine that determines the DupeCol from the column section selected, and determines the rowend from the last used cell to the right in the rows in that column selection. But I don't know how to do that and keep the values as strings.
VB: Dim RowEnd As String, DupeCol As String Dim LastRow As Long DupeCol = InputBox("Type in the letter of the column you want to look for duplicates in.", "Fill in the Info") RowEnd = InputBox("Type in the letter of the last column you want colored.", "Fill in the Info")
I would like to choose an option (C, Q, T) and get a result in 1 column.
In other words, if I type C in H6, I must get a different result in I6 as opposed to if I choose Q or T in the same column. However if I leave it blank I should have nothing or a 0 in I6.
In the attachment above you will see that I gave a sum for C (A3), Q (A4) and T (A5). The sum for each one is broken down into a percentage rate and a flat rate.
These rates are dependent on the initial amount entered into G6. C, Q, T stand for Cash, Cheques, Transfers. The form of transaction determines the % and flate rate to be charged.
I'm working with box quantities and would like to get a formula that would take the box quantity and return the largest value based on some parameters. Here are my parameters:
Obviously options 2 and 4 are no good as I can only work with even break downs. This leaves me with either 3 or 4 and because I want the largest, I would choose number 3. What I need is help on a formula that will take the value of the box quantity and return the largest whole number. I think for the time being I would like to leave the break down between 2 and 5 as well.
What do I do if I want to determine whether an input is within a specified range, and then for there to be an output of a certain value from another cell?
For example, with tax brackets: if income (D) falls within B and C, return value A(from a separate column)?
Column D, cell D1 is where you would input a number (income) Column E, cell E1 is where I want the output value.
Basically, what I would like is a formula to put into column E that will do two things. First, to determine if the value in D1 is within either (B1-C1, B2-C2, B3-C3, B4-C4, or B5-C5). Second, to then output the value of either A1, A2, A3, A4, or A5, for each respective range.
I want to write a function that goes out and reads a cell, waits a few seconds, then reads the cell again, since it is constantly changing. Then report back the difference between the two readings of the same cell. The following code does not work since t0 and t1 always come back the same value.
Code: Function ReadTime(t) t0 = t DoEvents Application.wait Now() + TimeValue("00:00:15") t1 = t ReadTime = t1 - t0 End Function
formula I can use to determine age between date of birth (in one cell) and an event date (in another cell)., i.e. birthdate 3/15/2000 with an event date of 3/2/2007.
I am having a bit of amnesia right now, but I know there are some smart cookies out there who can do this in a second or two.
I have a certain range in a worksheet (D6:D27). I need to find the first blank row, or the last row with data +1. I would like a worksheet function of some sort that might be used like this
=LastRow(D6:D27)
The result would be row 10 (the first blank row).
I have been searching for the past hour and just can not get anything to work right. I have tried many different suggestions, but I still draw a blank.
i have this code behind a command button in a userform
Private Sub cmdCalculate_Click() If Me.txtLength.Value > "6.021" Then lbM2.Caption = Val(txtHeight) * Val(txtLength) End If End Sub
the calculations work fine up till i enter anything over 9.999 in the textbox called "txtLength" Can any one see why this will not perform calculations when the entry is more than 9.999 in text box "txtLength"? i tried replacing the label control with a textbox!
I want to easily determine the max value of the stocks I own by only changing the daily value but i cannot bypass the circular reference problem. Example:
Stock|Today's Value| Max Value A | 1 | 1 B | 3 | 3
Tomorrow i'm going to change today's value and my goal is that the max value remains unaltered if today's value is smaller. like this:
Stock|Today's Value| Max Value A | 2 | 2 B | 1 | 3
I am working on a spreadsheet where individuals must enter a value between 1 - 4 or n/a. I would like to include a formula for each question where if they enter a value between 1-4, this scores 1 and if they enter n/a this scores 0. Does anyone know a simple formula I could use, I have tried IF formulas but keep getting muddled.
I have 4 TextBox on a UserForm. First three to enter value and the last one to return the lowest value entered in to the first Three TextBox. How to determine the lowest value and show it on last TextBox.
how can i get excel to read column c and return the answer into column f i have scores in column c that look like eg. 2-2 what i need excel to do is count the goals in the example obviously 4 and then in column f if its over 2.5 return the value over but if its under 2.5 it returns under is this possible please given the format of column c?
I'm sure it is possible to solve this with an array, despite all my efforts having produced nothing so far. Attached is an example workbook. On the 'Data' sheet, every month the data will change and I need to fill in column A, with the approriate Name from the 'Map' sheet. Is this possible using an array?
I'm am trying to find some way to determine if a particular tab falls before/after/between other tabs in a workbook. For example, if I have a tab "Top" and a tab "Bottom", I want to be able to determine if tab X is between them.
Is there a way to automatically determine the final row number showing after a manual filter operation? Or maybe getting a list of the row numbers showing on the screen.
The project requires a macro that loops through only the rows of a filtered list, not all of the rows in the worksheet.
If I have a multiple workbooks open and I want to determine if a workbook is open for example "Test 1.xls", how would I do that. I want it to msgbox once to say "open" if open or msgbox "not open" if not open.
I managed to write my script with pretty much the info I could find on the forums (yes!) but I need to write my data to the last row. Columns A - D of the last row will be populated with the content of my variables. This little snipped gives me the first empty row:
Can anyone help me in finding how to write the command in VBA to determine what Cell was selected in a worksheet? The objective is to know what Cell has been selected by double click event to pop up a userform with a calendar from which the user can select the date. I am looking at making it dynamic so I do not select a particular range.
I have tried searching for a way for VBA to recognise in VBA if a cell contains any text, but most of my searches respond to specific cases for specific characters in a string
Basically, I'm just looking for the correct way to word a string of code that if it detects any text in column B (col 2 ) then it should not do anything, else it should cut the value in col 2 and paste it in col 8
I have a macro which formats charts. It takes a user selected chart and formats it.
I would like to allow the user to select many charts and process them all at once (instead of just one at a time).
The problem is that when I have X charts selected in Excel, the Selection object assumes the "ChartObjects" type which includes all charts in the worksheet and not only those which are selected!
If I do "Selection.Count" it will count all charts (selected or not) and if I do "Selection.Item(x).Name" I can access any chart on the worksheet and not only those which are selected.
Questions:
1. Is there anyway to determine which charts are selected by the user? Either using the selection object or any other method?
2. When I select multiple objects (chart and non-charts), the selection object assumes the "DrawingObjects" type, which when counted returns the correct number of selected objects. However when I try to access them via "Selection.Item(x)" I again can access all DrawingObjects in the worksheet. Is there anyway to determine which drawing objects are selected? And access them (so I can determine whether they are charts)?
So, for example, we would start with the first element of the first line and work our way down through each subsequent line on the first column and wind up with combinations as follows:
So, in essense, the first element in each array row may be either a 0 or 1, the second either a 0 or 2, the third either a 0 or 4, the fourth either a 0 or 8 and the fifth either a 0 or 16. If a zero appears in any of the combinations, I do not want the 0 entry to the list of combinations. So, for example, if a combination gives (from the first column above):
1, 0, 1, 0, 0, then I do not want to include the 0 as one of the combination elements and we would have as some of the possible combinations: