string variable

  1. B

    VBA to Open an excel file using Inputs

    I'm trying to get this code to open a file for me: Sub openfile() Dim A As sting Dim B As String A = Application.InputBox("type value of A here:") B = Application.InputBox("type value of B here:") Workbooks.Open Filename:= _ "D:\Users\" & A & "\Documents\" & B & ".xlsx" End Sub...
  2. S

    VBA; String variable; If Statement; Empty cell

    Dear Forum Members, I am hoping you can assist a newbie here. The following is required from my VBA code: A cell input is made in the "Form" sheet and compared with a cell in the "Formdata" sheet. If the cells are different then a MsgBox is displayed with a warning and the cell is deleted...
  3. R

    Naming a Range read Name from String Variable

    Hi people! I'm fairly new to VBA and I'll appreciate your help on this. I have an argument in which I'm defining a named range, the argument is as follows: ActiveSheet.Names.Add Name:="JanMax", RefersTo:=ActiveSheet.Range(max) In this line, I'm creating a range with the name "JanMax" and it...
  4. M

    Select file, assign to variable, use in vlookup

    Hi I've been on another thread where I asked if it was possible for a user to run a macro that asks them to select a file on the hd to open. I was given the below code. It works well for selecting/opening another file, but what I would really love for it to do would be to assign the file name...
  5. A

    Referencing a sheet with a variable of type string in a macro

    I'm writing a function that gets data from a worksheet with a name dependant of the value of a cell. The cells value (e.g. Sheet1) is called into the function as string_name. Essentially I want to transform this code xrange = Sheets("Sheet1").Range("I2:I20").Value into something like this...
  6. KG Old Wolf

    .FormulaR1C1 with variable

    Goal: use "If" formula in R1C1 to evaluate cell contents; if "true" use Variable, if "false" use Constant Issue: Constant works fine in all code snippets. Variable works fine when a number (Work_2) but FAILS when text (Work_1). Following are 3 different approaches I've tried to no avail. I've...

Some videos you may like

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top