else if statements

  1. SkywardPalm

    Finding and comparing dollar totals calculated from two different sheets to raise a warning if they do not match

    I was curious if I do not need the ElseIf statement, since the If and ElseIf have similar structures and I potentially need to search in more columns if the Current total was not found (shifted to the right due to sub-section values). Maybe there is a more dynamic way of finding the $ total that...
  2. G

    VBA cross checking from another workbook

    I have two workbooks and I need to cross-check values from workbook A and see if it exists in workbook B. If the value for a row does exist in workbook B, I need 'true' to appear at the end of the row and if it does not exist, I need 'false' to appear. At the moment this process is manual cross...
  3. D

    Trouble using isdate and checking if cancel pressed.

    Hello all, I am a definite newby to all this, so please be gentle with me! I haven't done programming really since back on the Commodore 64. Some of this seems intuitive, some just does my head in. I have the following code: Sub GetDate() 'set colours for pass/fail validations ok = 42 notok...
  4. M

    Multiple tables on one spreadsheet. Adding data to particular table according to ListBox.Value selected

    Hi all, I have two tables on one spreadsheet (LiveProjects and TenderProjects) and I wish for a new row to be added with the data entered from the UserForm. The coding I have done for this works but what I particularly need is that depending on the 'Status' selected from the StatusListBox, the...
  5. L

    COUNTIF each occurrence and subtract 2 from each occurence

    Trying to calculate the number of "T's" in a table row and I do not want to count the first or the last occurrence, so in essence I want to subtract 2 from whatever my total is. I have that working, maybe not efficiently, but it is working. Here is what I have...
  6. C

    Compare data, if, then else if ?

    Hi. Sorry, new to this. Need to find a way to semi process some data. Perhaps easier to demo with a table. My data is column A has changing values, ie site names is not a constant, but the rest of the text is. I have about 50 of these statements. Each of these statements can be associated with a...
  7. R

    End if Without Block If Error

    Hi All, As im sure youve all heard a million times I new to VBA and I am self teaching myself VBA for work and self betterment. I set myself a personal project for home rather than always stuff for work to keep a stock of what we have in our multiple freezers. The problem i have is exactly what...
  8. M

    if - else - then - elseif vba code

    Hi all, I'm having a bit of a night mare. with some simple code that you lot will no doubt be able to fix instantly. The code is simple: Dim time As Integer, result As String time = Range("K3").Value If time > Range("k15") Then MsgBox "K3 value exceeds total time of test. Lower value"...
  9. N

    Problem with IF coding

    I am having a problem when a macro runs. IF I don't want to delete order data, it should do nothing and return to the front sheet. IF I do want to delete data, it runs the correct process. At the end of my coding under ELSE, it will show a dialog box advising a user to re-enter a year, but it...
  10. T

    Decide which macro to run based on cell value

    Within a macro 'decision' I want to call depending on the value of the cell value in B75 that either can be ''text1'' or ''test2" the corresponding macro 1 or macro 2. I tried several ways but I simply cannot get it to work. Any help would be appriciated. Kind regards, Theo
  11. A

    Else If Statements

    Why doesn't my else if statement work? I seems like it should work. The error I keep getting is "Else without If" Application.ScreenUpdating = False Set x = ActiveCell Count = Range("a65536").End(xlUp).Row For e = 2 To Count If Cells(e, 10).Value = "A" Then Cells(e, 10).Value = "Yes"...
  12. S

    Resume Next issues

    Hi All, I’m a newbie to VBA, but I have managed (with the help of some coworkers and Google) to put together a code to make a table and fill the cells with appropriate testing information. The code I have written has an if statement and it’s supposed to go to a block and then resume where it...

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