syntax

  1. E

    how to combine if statement syntax for Search function with 2 possible values: "N" or "S"

    I currently have the following Excel If statements: =IF(ISNUMBER(SEARCH("N",C37)),'Plan Code info '!C2,"") =IF(ISNUMBER(SEARCH("S",C37)),'Plan Code info '!C3,"") What is the correct syntax to combine these into one statement so that I can have logic to handle if there are values of "N" or...
  2. J

    Declaring variables: VB.NET Vs. VBA?

    In VB.NET, a variable is declared using the syntax Dim Foo As Integer = 10 I have just discovered that in VBA this does not work, and must instead be written as either Dim Foo As Integer Foo = 10 or as Foo = 10 Is the second of these an acceptable way of declaring a variable? If not, what...
  3. P

    Need help with concatenation syntax

    I've got this egregious bit of code here. It won't do any good to explain exactly what its trying to do; the main part I am trying to correct the syntax for s in the first "Indirect" function. I am trying to pull references from two cells into the formula, from cell C3 and cell H3. I am getting...
  4. J

    Syntax Help - Sumif and AND

    Hi, Can someone tell me how to cross reference a sumif / countif using an AND for 2 criteria. I want to say if the NAME = John and the DATE = 01/07/2018 then sum. My names are in the column and the dates are in rows. Can someone help with the syntax. Cheers, John
  5. T

    Syntax problem

    Can someone please help me with the syntax in this video: https://www.youtube.com/watch?v=WqyroALr2PE 1 minute and 15 seconds into it, the function, GetStock has this line: If (CStr(stock.StockDate) = CStr(StockDate)) Then Set TestStock2 = stock But TestStock2 does not exist. Thanks
  6. R

    What are other syntax to count unique records?

    Hi Everyone! I have the formula below that counts unique records the only thing is it slower my file. =Sumproduct(1/CountIf(B5:B10000,B5:B10000&"") Is there any other syntax that I could use to count records aside of the one above? Thanks in advance, Rev12
  7. C

    IF Statement not working

    Hi! I am trying to convert 'TRUE/FALSE' values into binaries (0 and 1). I am using the IF statement =IF(B2="FALSE",0,1). The list is returning either all zeros or all ones. Ideas on how to fix this? I have tried converting to text and to general. I believe the syntax is correct as I have used it...
  8. F

    Indirect function syntax to refer to a named range in another workbook

    Can somebody help me with the correct syntax for this named range which is in another workbook. I believe I should use Indirect, but I can't get the syntax right. =VLOOKUP(A3,Test.xlsx!MyRange,4,0)
  9. C

    Dynamic Hyperlink Creator

    I have an existing function that creates a hyperlink because the syntax of that URL is baked into the function. This works perfectly fine for a single website; however, the solution becomes obsolete and inaccurate when multiple websites are thrown into the mix. In the sample below, Column A is...
  10. J

    syntax to assign table cell values to variables... losing my mind!

    Hi all, I have been reading the internet all day trying to figure out how to properly reference tables and i have tried everything i could find but so far am at a loss... I've recently begun using Power Query a lot, so I figured I'd better learn how to refer to tables in VBA... it seems like it...
  11. A

    Multiple AND help, please...

    Hello All, I am trying to have a formula evaluate three AND conditions, all of which must be met, or I should get a return of "". For whatever reason (I think it's me, lol) I can't seem to get this right - been working on it for a while and it must, for sure, be syntax related, and I am just...
  12. A

    #Value error

    Hi guys Id be grateful if you can help. Im getting a value error on this formula and I cant work out why this is the case The Vlookup returns the value 421 - So Id like the formula to resolve to =ROUND('BlueCross Rates'!U421,3) =ROUND("'BlueCross Rates'!U" &...
  13. bencar

    How to Remember SUMIF and SUMIFS Formulas

    Hi guys, I get confused as to the syntax between SUMIF and SUMIFS. Do you know a way you guys can remember each syntax without getting confused one with the other?
  14. A

    Syntax / Compile error

    Hi all, Havethe following which works fine as a formula in the workbook: Range("AD2") = "=DATEVALUE(TRIM(MID(AE2,FIND(" ",AE2),3))&" "&LEFT(AE2,FIND(" ",AE2)-1)&" "&TRIM(MID(AE2,FIND(" ",AE2,FIND(" ",AE2)+1),5)))" However, if I try and use it in VBA I am getting a syntax error (expected End...
  15. J

    Using variables to loop through UF controls

    I have a userform (as you might suspect from the title :) ) with several (100s) of textboxes and comboboxes that will be posted to a worksheet. I'm hoping I can loop through all the controls instead of typing out each one. I tried to use this: For i = 1 To 6 ActiveSheet.Range("B" & i +...
  16. N

    Apply macro to entire column, need help on macro structure too. (VBA)

    I am using this code to run a macro everytime a cell in column H changes. Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("H:H")) Is Nothing Then Call DefMacro End If End Sub The macro I am trying to use is supposed to make cells in column 'I' change in...
  17. L

    Sorting by cell color

    I used the macro recorder to get what I wanted, now trying to shorten and simplify. I want to sort by all my red cells at the top, then by number descending. Can't figure out the syntax of the code. I've never used VBA to sort by color before. Here's what I've got. Sub sortred() LR1 =...
  18. D

    ISREF syntaxx

    In Excel VBA, I can run this code: if evaluate("ISREF('Sheet1'!A1)") then I now want to expand on that to refer to a sheet on another open workbook. I found this syntax online: if evaluate("ISREF('[MyFile.xlsm]Sheet1'!A1)") then If Sheet1 exists, it returns true. If Sheet1 does not exist...
  19. S

    Syntax error in defining range using a worksheet function

    Greetings, I am receiving a compile error on this line: h = worksheetfunction.Slope((Cells(yy,ww):Cells(2,ww)),(Cells(yy,xx):Cells(2,xx))) the first colin in the Y's range is highlighted. What is the correct syntax here again? Thanks!
  20. D

    vba excel - syntax for accounting Number Format

    What is the correct syntax to number format a cell to within a loop? I have: dws.Range("B" & dlr).value = cell.value dws.Range("C" & dlr).value = cell.Offset(0, 1).value dws.Range("F" & dlr).value = cell.Offset(0, 3).value dws.Range("G" &...

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