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

    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...
  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

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top