If And - If Or Statements: Import ( On The Left) And Input By Hand To Get The Process Going
Dec 14, 2008
The questions are shown on the attached spreadsheet. There are 2 questions one on each sheet. On the spreadsheet the yellow cells indicate data that I'd import ( on the left) and input by hand to get the process going. The green cells have the correct numbers in them but I've had to manipulate them by hand.
I have a form where I want to change the color box on the left hand side see attached image. Now it is a static and I want it dynamic where the user chooses the color. Now it is constant using an image with the color green, red, blue, etc... I want a color picker so user can pick their own colors and when the color is picked the code will pick the color number.
Is there a way (in VBA) to position a specific cell of a worksheet in the upper left-hand corner (i.e. cell H40)?? I have some code that I'd like to have do this.
Need a way to switch the default positioning of pivot table row totals? I would like to left justify them insead of always having the totals on the far right side where they are often out of view to the user without scrolling. I end up having to place 2 pivot tables side by side so that I can make the totals appear first.
I've been given a spreadsheet that is poorly constructed but I'm not allowed to alter.
The layout is: Box Name Box Date ID1 ID2 ID3 .... Where there is not a fixed number of IDs in each box (There are five different sheets so I'll have some fun concatenating results)
Given a list of IDs I need to return the box name and box date that the ID's file sits in. The spreadsheet has blanks everywhere and the numbers contained in rows are non-consecutive and smaller values can appear later in a column than larger ones.
I think I need some combination of index, offset and maybe sumproduct? TBH, I avoid sumproducts like the plague, preferring to utilise sumifs and dynamic named ranges since this improves clarity so I'm basically a newb at them.
Any skeleton framework that you think would work to return the text values for the LHS where the number could be anywhere? Once I can see a rough example I should be able to get to grips with the logic and wrangle it into the necessary solution.
I have two macros one of which imports the data and the other processes the data. These macros were created at different times and need to be joined into a single macro that will combine their operations – with slight modification to the importing macro. Let me describe what each of the macros does:
PROCESS macro: Cycles through the CONTROL CELL on the “1” tab using the VALUES TO TEST. For each value to test it copies the values form the output tabs and pastes them into the A+B tab. Then it removes the duplicate rows there.
Option Explicit '====================================== Sub PROCESS() 'This subroutine is called when clicking on the first button Dim i As Long, j As Long, k As Long 'Those are the variables that will browse through the whole sheets Dim l As Integer 'this will be used to browse through the values to test Dim TheSearch(1 To 2) As Object 'This is an array of objects that will be used for the search Dim TheRange As Range 'This will be used to flag the range of duplicates in the output
'Searching for the Text string 'VALUES To TEST' in the sheet "1" in order to know where the array of values to be tested start Set TheSearch(1) = Range(Cells(1, 1), Cells(ActiveSheet.UsedRange.Rows.Count + 10, ActiveSheet.UsedRange.Columns.Count)).Find(What:="VALUES TO TEST", LookIn:=xlValues, Lookat:=xlWhole)
i did some VBA quite a while back, and picking it up again.
I'm trying to get a function to read in a string, and return a value based on the string value.
Public Function value(ItemType As String) As Integer If ItemType = " Upper" Then value = 40 ElseIf ItemType = "Middle" Then value = 50 ElseIf ItemType = "Lower" Then value = 25 End If End Function
When i tried using it at the Cell level, it keep giving error i.e. Invalid Name Error
Im trying to pull together a formula to achieve the below. What i have is a spreadsheet to be used by staff in different countries so im looking to make it easy to modify the categories used without the user needing to do anything complex with formulas.
The right hand side of my file (C:E) shows a code for each year we have covered a country with the year as a prefix (2014 - Blah). The left (A:B) is a summary showing the latest year we covered that country.
Current formula: {=IF(COUNTA(C2:D2)<=0,"","✔-"&MAX(LEFT(C2:D2&"0",4)*1))}
The current formula works fine if you set the columns to where the data actually is but for ease of use i need it to look at the data in rows 1:2 and match up the Continent/Country and then MAX the dates.
I have a user form that has a combo box "City" two text boxes one called "Flight" and the other "Date". What I'm trying to do is to prevent the user from saving the data input from the user form if any of those three fields is left blank. The code that I have so far checks all of the required fields, if any are left blank a message notifys which field(s) is left blank and return the focus back to that field. But the rest of code also fires.
What I really need is either to stop the code if any fields are blank and return the focus back to the blank field, the user completes the field(s) and clicks the save again, or better yet, pause the code until all the required fields are completed and then complete the save. (There is actually another 200+ lines of code in this sub, but I deleted it to keep the post a little shorter.)
I have three IF statements as below. the problem is if the first statement is true I want it to skip the next two statements or the result will be changed again.
DATE A B C D E 2/22/2008TRUEFALSEFALSEFALSERon 2/23/2008FALSETRUETRUETRUEPhill 2/24/2008FALSETRUEFALSEFALSETracy 2/25/2008FALSEFALSEFALSEFALSESharon 2/26/2008TRUETRUEFALSETRUEBill
On sheet two I need to list any date that has three or more true statements with the coresponding name.
I'm trying to solve for 'X'. My finished good inventory (FG Inv) is 80pcs. That will cover customer demand out to 2/3/2009. Therefore, I have 4 DOH of inventory.
I have a simple inventory spreadsheet that is doing everything I need minus one function. I have not been able to figure out how to make this work yet, maybe I can get some help. We remodel apartment complexes. I purchase material and hand it out to the contractors. I am using one page to track all movement of the items, but I have another page that I want to do that math and tell me what I should have on hand. Example: (On sheet1 "movement") I hand out 20 outlets. On my inventory on hand sheet I have a line that says "Outlet", the current quantity is 40. I have a drop down list so that on the Movement page I select "Outlet" in column A and in Column B I put in the quantity. I want to keep a running total on my IOHand page of everything, so that it would automatically subtract the 20 I just handed out and leave my IOH as 20. I have about 100 items on my IOH page. I assume I need a formula in the quantity cell of my IOH page that will search the Movement page and look for a match to what is in column A and Sum all of my "outlets" or "sinks" into the right cell.
I have a 2010 excel sheet containing 14 columns and 45082 rows in total. I am quite illiterate when it comes to writing macros but I know that what I need can be achieved with a set of codes.
To be more clear, I inserted two tables below. The first one represents the current data structure, and the second one is the way I want my data to look like.
Current data structure looks like Variable 1 Variable 2 Variable 3
I have created "front page" which allow user to enter their enquiry.
The formula will be as per below.
Issuing World Bank -->if amount less then 500,000 = amount x 0.03125%; if amount from 500,000 - 2.5mil = amount x 0.015625%
Royal Bank -->amount x 0.0625% x no. of month (min charges 100) Deutsche Bank -->0.025% per 3 months (min. S$50)
Stand By LC World Bank -->0.02% per quarterly (3mths) - Amount X Rate X 1 (1 to 3mths) or X 2(4 to 6 mths) or X3 (7 to 9 mths) or X4 (10-12 mths) Royal Bank -->0.25%p.a by day (Principal x Rate x Day divide by 360 day x 100)
Am I able to set a formula for example:-
1. When I click on Mode of payment - Issuing
2. On my right hand side under column "Bank Name" will list down all bank available
3. On my right hand side under column "Estimate cost" will auto calc the cost base on the bank's formula.
I am having trouble finding the days on hand for each SKU. I am trying to get a formula to look at how many days will the total SKU Qty cover in the Forecast_qty. I used a vlookup to make sure the sku = sku but i cant get the days on hand number.
I'm using commandbutton in a worksheet, and would like it to have the same cursor displayed as the 'forms' control.... for some reason, it remains an 'arrow' when the forms becomes a hand. I've identified the 'mousepointer' property, as well as the 'mouseicon' properties; however, it appears that for some reason, I don't have the hand-cursor icon on my system. (i've searched the hard disk, and apparently this is not entirely uncommon according to some posts I've found around the internet).
So my question/favor to ask is: 1) where can i find the standard windows xp system scheme "link select" hand-cursor (control panel->mouse->mouse pointers... last one)
2) I believe its filename is "hand-l.cur"..... if anyone reading this post can quickly check their windowscursors directory for this file, and reply/ upload it
I am having trouble filling a formulae series to the left on one spreadsheet, the fomulae being references to another sheet.
For example, I have two sheets 'Mtce Options' and 'Base Case'. In 'Mtce Options' I have the following formulae
A B C 1='Base Case'!A15='Base Case'!D15='Base Case'!G15
I want to fill to the left, incrementing the column references by a factor of 2 each time, eg. next two should be ='Base Case'!J15 and ='Base Case'!M15.
However, if I autofill to the left by highlighting A1, B1 and C1 or just B1 and C1 all I get is an inappropriate reference such as ='Base Case'!D15 or ='Base Case'!F15, respectively, in D15.
I have csv file with tab delimited fields (see attached blacklist.csv). 3rd and 4th fields are in format dd/mm/yyyy hh24:mi:ss, some fields can be zero. I need to split data to columns and display datetime fields in format dd.mm.yyyy hh:mm:ss.
OK... open csv in Excel, select column A, press button "Split in columns", select tab as delimiter, choose date format (DMY) for 3rd and 4th field and press OK. Test is splitted into columns, now select columns C and D and select desired format "dd.mm.yyyy hh:mm:ss". Then I select columns A:E and set column widths to fit data in columns. This all is OK and without problems (see attached file Handmade.xlsx).
But now... Now I record all previous step into macro. There is macro text: [Code] ....
Now I copy macro text into clipboard and open blacklist.csv again. Insert button to list and bind it to new macro. Paste text of macro from clipboard. (See attached file blacklist_beforeClick.xlsm). Now click button Btn and voila... some dates remain in previous format, some dates seems to be in desired format, but day and month are swapped. Why are there differences when comparing data made by hand and data made by macro??? compare.jpg This is the same behavior in more computers, some use Czech version of Excel 2010, some use English version.
Attached is a copy of my data and i want to find the mode of each months data without typing it out into long hand form, eg. 111122222333344444 etc. so i believe the answer will be some where around 5 for most of them, but i just don't know a formular to show it automatically on the spread sheet.
I'm attempting to import around 200 (and growing!) separate text files into Excel. I am using the formula below to import the text file and then using a separate macro to select the information I need, copy it into another spreadsheet, and then run the import macro again.
However, I have a problem in that my import macro gives me 'Run-time error '1004:
Application defined or user defined error''. At first this wasn't a problem as the information is pasted into the spreadsheet despite the error anyway. However, now that I am looping the macro it is obviously causing more problems as it prevents the loop. I would really appreciate it if anyone knows of a work-around or can spot an error in the coding to resolve this!
The code below shows is for the import macro only:
Sub ImportTextFile(FName As String, Sep As String)
Dim RowNdx As Long Dim ColNdx As Integer Dim TempVal As Variant Dim WholeLine As String Dim Pos As Integer Dim NextPos As Integer Dim SaveColNdx As Integer