vba if

  1. C

    VBA find and replace under multiple conditions

    Hi there, I want to create a macro where I can find and replace the wording of my data in one column depending on the condition of another. I would like to search column A for "Scotland" and "Southern" then if column J is "SHIPPER" change column A to "Scotland Transport" or "Southern...
  2. Z

    VBA: Use IF/OR to validate multiple String values

    Hello, I'm looking to see if there is a way to combine multiple string values to validate against in a more concise way than I am currently. I use a macro that clears all filters. However, there are three Tables in particular that I often want to Sort afterwards. Maybe I can use an array with...
  3. A

    Macro to hardcode a row based on formula output

    Hi, I have a workbook that contains an excel worksheet, in which each cell in column A (starting from row 16) is a consistent formula returning "Yes" or "No" based on conditions within other worksheets. I am trying but failing to write a macro that: a) searches column A for rows containing...
  4. T

    Move and copy the next destinated column and copy if the main target column is empty

    Sub Macro2() Dim ws As Worksheet, MasterSheet As Worksheet Dim originalDestinationCell As Range, nextDestCell As Range Dim firstGreyCell As Range, rangeToSearchIn As Range, c As Range Set MasterSheet = Sheets("Sheet1") 'where you want to put the copied data Set...
  5. I

    VBA Excel IF

    Hello, I am building my first VBA Macro Excel (button) and I need help with it as I am unfortunately unsuccessful. Basically in one column, I have name of the countries and I would like in the second column to have if it is a EU Country or Non-EU Country. I tried to test it only with one...
  6. D

    VBA code to insert row if value not found in some range

    Hi as you can see on the picture I have 3 tables with dropdown menu and one final where weighted average is calculated, what I want is to have VBA code which would search in range of those 3 tables for names of ingredients and if ingredient not in last table (weighted average IBR.) then to add...
  7. R

    VBA code with IF, cut/paste, & last column

    I have a list of travel details where each row is a different leg of a travelers journey. There are common details at the beginning of the row, such as passenger name and such. In order to use the data to auto-fill a templated itinerary I need to align the legs of the journeys per passenger...
  8. A

    Need help to tidy up Code

    Hi I have the Following Code that repeats its self every 30 rows. is there a way for make the "IF" do this until the sheet no longer as filled in rows as the procedure is too large to run at the mo. I realise i can split it up into different subs, but i would like it to all run together...
  9. D

    VBA if cell value>0 copy this row & insert row under

    I need to create VBA that will insert & copy current row if value in column D>0 & do this all the the way to the end. I need VBA that will work as VLOOKUP but for multilines. Let's say A7="Paris" Sheet1. I need to copy a all values (if A7="Paris") from sheet2 column B, C, D etc.
  10. K

    VBA - If Cell Contains Email address

    Hi There, I want to get a VBA code for checking if a particular cells has got any email address Suppose Cell A1 = abc then it should give error "Please enter a valid email address" and If Cell A1 = abc@xyz then it should let the user enter that value as it is a valid email address VBA code...
  11. I

    Can you Reset a Counter used in an IF statement?

    Hi, I'm using a counter (daycount) in an IF statement that is nested within a larger IF statement (that uses counter), but I need it to recycle and repeat a process using the daycount. Is it possible to reset a counter to its starting value? Thanks, Ian.
  12. D

    VBA If statement not working

    I have made an If statement that, will make a date go 3 months on from the date you select on a drop down list, today, yesterday, 2 days ago, and 3 days ago. And when you click the button it changes the date on the cell 2 away from teh active cell. But for some reason the first 4 If statements...

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