if then and else macro

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. S


    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...
  6. 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...
  7. 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...
  8. 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...
  9. 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

Some videos you may like

This Week's Hot Topics