declaration

  1. G

    Conditional variable type declaration

    I have an API module that suppose to work for multiple programs. The object type refer to different reference for each program, but they are actually same functions inside the library so VBA code would be same for each program. I want to make my code short (implement DRY). Ideally, I would...
  2. G

    VBA: How to declare a variable and set initial values in one line?

    Hi, I want to write variable declaration and set the initial values in one line. I see some examples for that, but it doesn't work in my excel. Here are some examples that failed: Dim longArray() As Long = {0, 1, 2, 3} Dim longArray As Long() = {0, 1, 2, 3} Dim longArray = New Long() {0, 1, 2...
  3. diddi

    Getting elements of a Type declaration

    hi I was wondering if it is possible to determine the elements within a declared Type. so as an example, I have a variable "Invoice" as declared Type Invoice Job As Integer CustomerRef As String * 20 Amount As Single End Type Dim MyInvoice as Invoice is there some way of...
  4. R

    Array Declaration doesn't work on MAC?

    Hi all, I am trying to define an array in VBA on my Excel for Mac, but the declaration shown to be an error. Thank you for your help! dim array(2)
  5. A

    VBA declar & pass worksheet name through subs

    Hi - I would like to pass worksheet names through multiple subs, but I'm not sure the best way to do this. I would like to say that w1=Sheet1, w2 = Sheet2 and be able to use w1, w2 through all subs. Below is an example. Thanks!! Dim w1 as Worksheet, w2 as Worksheet Sub RunAllSubs() Test...
  6. M

    Declare one string with multiple variables

    Hi, I'm looking for way around getting multiple values set to one variable declared as String. Following codes might give you a glimpse of what I'm looking for. Dim Name as string Name = value1 or value2 or value3 If range("A1"). Value = Name then Activecell.entirecolumn.delete End If
  7. S

    How to create XML without declarations

    Maybe I have been asking the wrong questions? Is there a way to create an XML file without the XML declaration and schema reference? Our ancient inventory management system will not accept anything that is not an XML document without those two lines. I know, I know. I am pushing them to...
  8. U

    Public Declaration is not public

    I have declared several variables as public but FstCvcCol will not work publicly. Can anyone tell me why? Public Type myType RowColId As Long cellStr As String End Type Public GlobalArray(100) As myType Public IndentLevel As Integer 'Index Level for task...
  9. K

    Using code at multiple places

    Hi, I have the following code: Option Explicit Option Base 1 Private MyOPCServer As OPCServer Private WithEvents MyOPCgroup1 As OPCGroup Private WithEvents MyOPCgroup2 As OPCGroup Private MyOPCItems1, MyOPCItems2 As OPCItem Private Sub CommandButton1_Click() 'connect Set MyOPCServer =...
  10. A

    Clearing data from a type declaration

    Hi. Is there a quick way of clearing all data from a data type that I have created myself? The type itself is: Private Type OptionType2 oFrom As Integer Choice As String oTo As Integer End Type ...and then I have declared it: Dim Option2(40) As OptionType2 Instead of looping...

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