variables

  1. C

    Collection, class, printing

    I have a collection with a custom class and I don't know how to print the items in the collection. Can someone help me? The collection = datacollection. The class = bobjclass class variables = country name, Amount, Account, Account name.
  2. JazzSP8

    Syntax for Copy / Paste Range using Cells?

    Hey All I can't seem to get the syntax right for this and I'm at the point where I'm understanding it less the more I read :/ I'm trying to copy from one worksheet to another with a variable paste range but I can't seem to get the paste part to work, this is what I originally thought would...
  3. M

    Vba - combine formulas stored as variables

    Hello, Please can anyone help. And please forgive any errors in terminology. I have stored two formulas as variables which I can see are correct on the Locals window. I now want to combine these two formulas together in another cell. So far I have following but I cant seem to work out how to...
  4. S

    Saving VBA variables for next time workbook is opened

    I have VBA variables of types range, long, and string that I would like to save before the workbook is closed so their values will be preserved for the next time the workbook is opened. I have done some searching and so far the only method I can find for doing this is to assign the variables to...
  5. D

    VBA to search columns to find a number of variables

    Hi folks, I'm back again for more genius advice on how would I achieve the following... I would like to run a macro that will search for a number of variables and assign them for later calculation. For instance, as simplified version: I have a sheet with a number of pivot tables on it. I...
  6. S

    Global Variables across multiple subs

    I'm having trouble with dimensioning variables to be used across multiple subs. I'm trying to keep the length of the individual subs as short as possible, and currently the only working version requires me to run the dims in every sub. In its simplest form... Sub Master RunSub1...
  7. W

    Calculator based on differing variables

    I am hoping to be able to calculate a date range when an initial scan would be required for a patient treatment by working backwards from the date of a patient treatment and factoring in different variables. Variables would include varied timeframes based on differing complexity and staff leave...
  8. O

    Use variables inside Range Object

    Guys, I'm trying to select all the cells on my worksheet. In order to do so, I was thinking about trying to use range and the variables lr and lc which stand for last row and last column. However, currently it's not working. This is the code I have: Sub Graphs() Dim lr As Integer, lc As...
  9. L

    Userform values do not equal

    I am making a duplicate entry notification. But the values will not equal for the notification msgbox to kick in. I have made this work before with another line of code by dim the value as double. But this will not work at all. Please take a look and tell me what you think. Dim Line1, Line2...
  10. B

    All variables for 8 soccer matches

    How many possible outcomes are there in 8 soccer matches
  11. K

    referstorange problem

    I have an addin that has range names that are used in code that is called from another open workbook. Most of the range names refer to a single cell and I successfully use the value of those cells with the following code: the first three variables are public variables declared as strings...
  12. D

    select, declaring variables....

    i'm genuinely curious....does eliminating "selecting" and declaring variables really make a difference with performance nowadays? sometimes i get this feel people that just say selecting is the root of all evil cause it screams recorded code ....but from my experience (but maybe the macros I...
  13. K

    Multiple criteria in conditional formatting

    Hello :) I am using excel to demonstrate supply Vs demand, with regards to project resource capacity. What I am trying to achieve (using conditional formatting), as a look up between two sheets, that identifies IF (name) in Sheet 1, has a capacity less than usual in Sheet 2, then highlight the...
  14. C

    UserForm Level Variables Scope Question

    I have several variables declared at the top of my UserForm (outside of any procedure), some of them are ranges, ListObjects, and PivotTables. Is it necessary to use Set variable = nothing before closing the UserForm to remove them from memory, or will they automatically go out of scope when...
  15. B

    Index-Match using variables

    I am trying to insert an Index-Match function into a table. I get an error message when I try to use string variables in the formula. The below works: Dim T1 As String Dim T2 As String T1 = "Table1" T2 = "Table2" Sheets("Orig").ListObjects(T1).ListColumns("Revised").DataBodyRange = _...
  16. D

    #NA on mult-variable Index/Match Function

    https://www.dropbox.com/s/0ulhnl1wd60qvgq/N%20Plain%20Disappearance_5JUL18.xlsx?dl=0Trying to match 4 variables, but receiving #NA . I've incrementally built formula, and three variables pulled in expected value. Adding of the 4th variable is apparently the issue, however it looks correct from...
  17. L

    shorten vba of repetitive task

    I want to store the SUB below in a module then to call it from anywhere so that I don't have to write the code over and over again... My problem is how/what to declare of the variables (in the SUB line) THEN when this sub is called, it will be as below: SUB SortSubtotal("client", "C2:C",3) SUB...
  18. A

    search and find location of colorindex = 16

    I have several locations in my spreadsheet that have merged cell location that has the colorindex of 16. I want to save the address of the different locations in my sheet that have colorindex of 16 to several variables or an array.. How can i do this? thanks
  19. A

    Assignment of zero value in formula depending on the combination of considered wind parks

    Hi everyone, I currently write my Master thesis in the field of renewable energy. I want to implement the famous mean-variance analysis by Markowitz to show how all possible combinations of 10 wind parks are different in terms of return/risk ratio. There must be 2 specific formulas...
  20. A

    Strange Excel Crashes

    Hi all, So I'm working on improving my ability to write and understand macros (I'm entirely self-taught in excel, so I figure why change that now?). Basically writing Macros, then looking for ways to make them better/faster. Anyway, when I'm designing subs and functions, I put watches on the...

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