I have created a user form with a combo box and three text boxes. The drop down box is populated via the initialization of the form; code is posted below.
the "add item" names are names that are already on the worksheet in column 1. What i have done is used the command button "submit" to populate the information from the textboxes to the worksheet.
what i would ike to do is populate the empty cells below this area with the information that is in all three text boxes and the combo box. for the IF / elseif statments i have used the combo box as the condition. So the quandry is I cant input the information into the empty cells, i have tried a few things, my vba is very basic, as you can tell ihavent even DIM'd anything (i think that is another thread though :D )
here is the initialize code and below is the "submit button" code.
Private Sub UserForm_Initialize() 'sets values for text boxes cbomaterialdiscription.Value = ""..........
I am attempting to use a previously Set variable as part of the next Set statement, pretty unsuccessfully at present.
My purpose is trying to look up
Code: tb_SelJobID.Value
from a userform in Col Z then look across the row to Cols D,I,N,S & W (different types of work) to see if
Code: TbSelYr.Value
matches the year selected then insert a formula in the row to the left. Then loop down to the FinalRow.
Currently my Set Found1 statement does not recognise my Found10 value. I know it will be my syntax as it always is. I have cut down the following code to display where the problem areas are, Found1 thru 5.
Code:
Sub CmdGo3_Click() Dim Row As Range Dim FinalRow As Long Dim Found1, Found2, Found3, Found4, Found5, Found10 As Range Application.ScreenUpdating = False
Basically it is a if statement saying that if the selected cell falls between 1/01/06 and 31/01/06 then Jan would be selected. The end part is not a problem; I’m just not sure how to write the one line of code that would test if the cell falls between the two dates. I attemped to create it as shown in the code attached below but wasn't successful. I used an else if statement to test the other 11 months.
Sub test() Dim SelectDate As Range Set SelectDate = Range("SelectedDate") If selectedDate >= 1 / 1 / 2006 And selectedDate <= 31 / 1 / 2006 Then ActiveSheet. PivotTables("PivotTable1").PivotFields("PnLDate").CurrentPage = _ "Jan" ElseIf selectedDate >= 1 / 2 / 2006 And selectedDate <= 28 / 2 / 2006 Then
I tried Conditional format and no luck. (Office 2010)
What I'm trying to do VB is:
If Cell B:B has value of "402" or "up" and Cell C:C is less >100 Then Change color on Cell C:C to "yello, red, etc" (if C value is <100 no color change)
Run-time error '-2147467259 (80004005)': An unexpected token ""20*"" was found following "1' AND PERIOD = LIKE*. Expected tokens may include: "". SQLSTATE=42601 code died at RS.Open SQL, CN ///////////////////////////////////////////////////////// Sub GET_OSI Dim sn as String, osi as string, saposi As String
I need some different columns within a row to calculate based on a statement found in an earlier column in the row. something similar to below. there will only be two statements total which are noted on the table below.
A B C D E
1 0 0 20 5%
[Code].....
So basically If column A = disposition calculate D and E in column B but if Column A = Receipt calculate in column C
The formula for D and E is not exactly as shown just using that as a quick example. I'm using office 2010.
I am using MS Excel 2010 want what to change a number of cells if a value is true e.g.
Row one has the headings Prz, Stat, Val, andPts Row two has the following values :- (Prz) a2 =2, (Stat) b2=1, (Val) c2=$30, (Pts) d2=10 How do I do the following in Excel :- IF B2=1 THEN A2+1 AND C2+30 AND D2+5 so that the above cells are changed to (Prz) a2 =3, (Val) c2=$30, (Pts) d2=10
I was able to use pivot table to set up the balance sheet and income statement.
1. now each month is a field which I can choose to add to the report, but the field list is getting too long (and growing). Is there a way I can insert 1 field (for the user to input the exact date) or 2 fields (to input year and month) and the pivot table can pick up the input and refresh either automatically or manually.
2. I looked into the "group" function in pivot table, but how do I group the above data in quarterly and yearly fashion so the user can get those information quickly?
Excel 2010, I have the following list (showing part of it):
Name T-Shirt Sizes Nathan S
[Code]....
The aim of the list is to see what Sizes each and every person needs and then count how many T-Shirts are required for that particular size. The list is over a 100 entries long so counting it manually isn't really an option as it's time consuming as well as errors might arise.
Thus, I've been trying to use the IF statement with the following logic but to as no avail
IF Size in Column is XS Add 1 to a particular Cell IF Size in Colum is S Add 1 to a particular Different Cell
and so on for the other sizes...kind of like a counter for a for-do-loop.
excel 2010. This workbook has 4 worksheet(Process Engineer,OSBL,OSA,Lab Operator) I want to know what is the best excel formula/function to summary this 4 worksheet.
Example:I want a formula/function to summary all the statement from 4 worksheets and total number of answer "1" per statement from 4 worksheet.
Sample Statement below
"Demonstrate Interpersonal (People-to-People-) Skills" Question:What is the formula if above statement contains this statement in 4 worksheet?As i checked the total is 4 then What is the formula to get all total answered ICC on this statement from 4 worksheet?
develop a macro to send e-mails upon certain criteria, I then wanted to add a layer to the macro which I have, and it works... sort of. I'm wanting the Macro to send a specific e-mail if the dates fall between a certain range, a different e-mail if they fall between another range, etc... Here is the code I came up with:
Private Sub Workbook_Open() Dim LR As Long, i As Long, s As String, sb As String, sc As String, eml As String With Sheets("Vendor-Rltshp")
I have an enquiry where I'm trying to order error messages which occurs in if, ElseIf and Else Statements. The code I have works. However, I would like the error messages to be checked in a particular order. I tried rearranging the conditional statements but had no success. Here is my
I started changing it and then realized that I can keep going by adding new elseif's but i think an array would be a better option(i think). But i am really a monkey see monkey do kind of vba user. i can backwards engineer but cant come up with it.
here is code
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("$z:$z")) Is Nothing Then If Target.Value = "NO CONTACT" Then Target.Offset(0, 1) = Date + 1 ElseIf Target.Value = "NO CNTC FCL" Then Target.Offset(0, 1) = Date + 1 ElseIf Target.Value = "NO RES" Then Target.Offset(0, 1) = Date + 1
you see i keep adding "results" and assigning lift dates. what i would idealy want to do is take my list (that i use in a drop down box in $z) and next to it assign the number of days i want to set the next call date(the offset 1 cell) to be. then have the code just read cells a1:a10(the results) and assign the corresponding b1:b2(the amount of days to wait to call). I can keep adding elseif's but then if i decide to add new results codes or change the days from 1 to 5 i have to go back to the code.
In row 6 column O I need for the formula to look at column I and determine if the month is 1, If yes then I need for it to determine if the date is one of the following,
Day(I6)>=1,Day(I6)<=5), If TRUE Then do the following Cells(J6)*1.04)*2080/12 If False then ElseIfDay(I6)<=6,Day(I6)=<12, If TRUE Then do the following Cells(J6)*43.33)+((J6*1.04)*129.99 If False then ElseIfDay(I6)<=13,Day(I6)=<19, If TRUE Then do the following Cells(J6)*86.66)+((J6*1.04)*86.66 If False then ElseIfDay(I6)<=20,Day(I6)=<26, If TRUE Then do the following Cells(J6)*129.99)+((J6*1.04)*43.33 If False then ElseIfDay(I6)<=27,Day(I6)=<31, If TRUE Then do the following Cells(J6)*1.04)*2080/12, but put this into column P
If row 6 Column O if the month is greater then 1 then I need the formula to do the following, =J6*2080/12
What I am trying to do is have excel take columns O through Z look back to column I and determine which month the performance review is due in. Then I need for it to determine which week the increase rate will be effective for. So for each month the “If the month is >1” would change to 2,3,4,5,…..and so on.
In addition I am going to have the formula look at the shift and if it =3 then (J68)+1.00, but for the increase I have to have it -1.00 then J6*1.04+1.00. I will also have to create a table that holds the max rate for each grade, and then figure out the formula to figure out this new rate.
My code is below. See how I have repeated the same code over and over for each row. Is there a shorter way to write this, perhaps a cleaner way. Im not an expert and I write what I know and most of that is long code that can be shortened.
I am trying to send bulk emails from my excel 2010 - however I am getting a POP UP. find the screen shot in the enclosed word document So every time a new mail is sent from excel we need to press the button allow Is there a way where I can turn off this warning.
I have created a macro in excel 2010 which enable the file to save (extract) data into separate location and name. The vba code for macro is as follows: Question: How can I save this workbook with reference to the value containing in cell B2? (it is named temporary now - as defined in the code)
Recorded macro. The hope is to insert a excel formatted table a set number of times. I have found a loop code that references a Cell A1 and repeats that amount of times. So if A1= 10. There should be 10 tables inserted. However on the second time there is a fault with the table name. I need the name to change each time the loop is run. ie Table1, Table2, Table3 etc up until the loop stops (A1 contents).
I am using excel for windows 2010. The macro that i have so far is below.
Sub LoopTest() Dim n Dim V Range("A1").Select V = ActiveCell.Value
I am having an issue getting an IF statement to work inside a DO loop. I have Microsoft Excel 2007 and Windows 7 Entreprise.
In my Excel spreadsheet, I have in column B a list of keywords and in column C the category to which each keyword belongs. For instance, the keyword "boot" goes withe the category "Shoes", "scarf" goes in "Accessories", etc.
In another column, I have a list of product descriptions (like "Black Boots" or "Silk Scarf") and I would like to assign the relevant category to each product. I thought to do this by creating a new function in VBA. This function would go through the whole list of keywords in column B, checking if the keyword is included in the product description. If it is, the function's result would be the relevant category, and if it is not, the function would search the next line in column B, until a relevant keyword is found, or until the end of the list.
Here is the code I have written so far:
Code: Function SegmentSearch(Item) Dim i As Integer i = 1 Do i = i + 1
If Application.WorksheetFunction.IsNumber(Application.WorksheetFunction.Search(Sheet5.Cells(i, 2), Item)) = "TRUE" Then SegmentSearch = Cells(i, 3) Loop Until Application.WorksheetFunction.IsNumber(Application.WorksheetFunction.Search(Sheet5.Cells(i, 2), Item)) = "TRUE" End Function
Without the loop, the function works fine (if "Item" happens to include the first keyword in the list) but as soon as I try putting the loop I get a #VALUE! error.
I am using Excel 2013 on a windows 8 machine. It may be easier for me to explain the problem, before posting about the formulas. I maintain a retirement residence with alot of phone numbers. I have a list of all the numbers we own in one column and the numbers assigned to the PBX systems in a second column. By using a If formula I can tell which numbers have not been assigned (The true statement). My problem is when a resident passes away, I need to reuse that "phone number", but I dont want to reuse the number too soon. I am hoping to use the "true" from the if statement to generate a time stamp. I plan on using that time stamp against the "today()" in a days formula, I believe this will spit out the number of days a number has been idle. The time stamp would be constantly changing or removed as the if statement would always be changing. So column C gives the True statement and says "Number not Assigned" - this should create a time stamp in Column W
And looking from right to left, I am asking this question:-
If K8=J8, then I will have K8 & I8 as my result. If K8=I8, then I will have K8 & H8 as my result. If K8=H8, then I will have K8 & G8 as my result. If K8=G8, then I will have K8 & F8 as my final result, Else its K8&J8 as my FALSE. (the $J$3 = a comma, for number separation, and further LEN string capture.)
Every time I have made this formula, with other types of Logic, it only ever finds the second tier depth as the result, and I wonder why, since they are several nested IF statements in line!!
The incomplete Excel sheet is attached : S 1_2 tracker Forum.xlsx
The result of the above formula should be 4,10 But instead I get 4,4
Background: The user makes a selection from a drop down box on the main sheet (sheet5, G12). The drop-down box is linked to *Sheet31.Pax_Nav*. If the drop-down box's linked cell value is less than 5, then do nothing (manual input required). If it is greater than 5, then the vlookup matches that number to a person in the database and returns their weight. The code will pull the required person's weight but then Excel will hang and freeze.
Private Sub Worksheet_Calculate() On Error Resume Next If Sheet31.Range("Pax_Nav") > 5 Then Sheet5.Range("G12").Value = Application.WorksheetFunction.VLookup(Sheet31.Range("Pax_Nav").Value, Sheet31.Range("H17:L48"), 5, False) Else End If End Sub
Cell BM22 is a percentage calculation of the differences between two different days of volume for this stock and that formula is: =(BH22/BH25)-1 Cell BM22 currently is calculating the result to be -65.65%
When I set up a CLASSIC Conditional Formatting using a formula (="If($BJ$20=""SELL""") to check the if the text in cells BK10 match the text displayed in cell BJ20 - I get no error messages and no formatting?
I am using Mac Office Excel 2011. I feel like I have tried everything including changing the Number selection type of the cells to TEXT. Nothing seems to works.
I am currently using an Intersect statement in a worksheet module to perform two things: 1. Insert a time stamp into row 2 when row 1 has a price inserted 2.To clear that time stamp if the price is deleted at some later date.
My problem is with the time stamp value being deleted by the user. If I try to clear the price (now that the time cell =empty) I get a Runtime error 91 - Object Variable or With block variable not set.
I would like to convert this code to a select case statement but I'm not sure how to do this in this situation. Would error coding be appropriate in this instance?