if then and else macro

  1. R

    Userform Textbox : If A and B conditons meet then show C value on userform

    Hello, Im wondering if someone can help me. I want to setup a userform in a way that i need 2 conditions to fullfilled to show a value in a textbox. In other terms, if my car model is A and its power is B, i need the price C to show up automatically in the price textbox. And i prefer to fill...
  2. K

    VBA: IF THEN, skip if file not open

    Hello. I don't use macros often (once every few years) but have a need for one now. I have a folder which houses individual monthly files (at year end there will be one for each month, so in theory one is added monthly), there is also a summary file. The example code below is for May and Jun but...
  3. E

    Macro for If date matches then paste value

    I have daily target figures (B2) that get manaully entered into a report sheet (Sheet 1) every morning. I want to be able to copy and paste the values on a separate sheet (Sheet 2) so I can track and store the daily target figures because they get overridden every morning and I want a backup for...
  4. L

    VBA If And Then Else Not Working

    Hi Guys, I have this VBA code which I thought was working, but it isn't. At least, not completely. I've spend hours trying to figure out what is wrong but I can't figure it out. Maybe someone here can find it? This is the code: Sub InsertRowAndCopyFormulas() Dim dest As Range...
  5. K

    If Then Else Statement .... Help

    I believe what I am looking for is a proper If Then Else statement to put into my current VBA code. What I have is Numerical values in Column H, of which the only 2 I am concerned with is 220 or 221. *If the value in the cell of Column H is 220 then the formula...
  6. A

    VBA. identify in different rows if data is the same in one cell and give same serial number

    Dear all, What I am trying to do is: When two rows have the same Project ID, then they have the same serial number. I could have 2 or more rows with the same project ID. Cannot write a code that works. I think the best is to use If Then Else. See the tables below for better understanding...
  7. S

    VBA, IF THEN, SELECT CASE or ...

    Hello All, First of all Happy Easter to all of you! I am a beginner in VBA and mostly self learner (using various examples if this forum and other internet sources). Currently I need to write a code however I faced a wall and I am stucked there. The code you will see in the VBA editor took me...
  8. X

    linear interpolation function vba code

    Hi, I have an interpolation function that I have tried to write in VBA. The results of the function are correct when the given X value (in my case sigma) is equal to or outside the bounds of the highest or lowest sigma. But when the given X value or sigma for which I'm trying to interpolate...
  9. T

    If then else compile error: Else without If

    Hi all- I'm trying to run a simple loop and I keep getting "compile error: Else without if" that doesn't make sense to me. Basically I'm checking a range for formulas and if there is a formula, I'll skip that cell. If the cell is blank, I'll enter a formula in an adjacent cell. Any help...
  10. K

    IF condition meets import line to another file

    Hi, I need help,i am trying to import a line from another excel file say "file-1.xlsx , sheet1", when a particular conditions meets in a column 'E' say when cell=today's date then import then full line to another file called "file-2.xlsx, sheet-2 in first empty line".Also the date from hidden...
  11. A

    Need Some Help with If / Then Statements

    here is what i'm trying to do I need a macro that does the following ----I have a diagram explaining what i'm trying to do ... this was the best i knew how to get my point across click on the link to view it LINK TO DIAGRAM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top