declare

  1. T

    Upgraded Excel to 2013 now code doesnt work

    Hi All, I just upgraded to Excel 2013 and now am getting an error saying I need to update my code to allow for 64bit. I tried changing to Declare PtrSafe Function but that didn't help. Any help is appreciated. The code that is generating the error is: <code> Private Declare Function...
  2. P

    Excel automatically inserting VBA code to "This Workbook" object throws 64-bit compile error

    My apologies if this has been addressed before. If so, I haven't been able to find the right keyword combination to find it. My system is Windows 7 with Office 2010 (32-bit). I have an Excel template which has evolved over quite a few years, and I've hit a new issue. I sent the template to a...
  3. R

    Best practice for managing variables

    Hello, I am basically self taught with VBA and I am making more and more complex macros. I am finding that my variables are all over the place and I was wondering what the professionals do in regards to variables. Do you declare all variables or just the significant ones? With the...
  4. D

    Declare Function 32 to 64Bit

    Good Day All the Code Below works with 32 Bit what code For Excel 64 Bit ? Private Declare Function mciExecute Lib "winmm.dll" (ByVal lpstrCommand As String) As Long thanks
  5. M

    Can I declare global arrays with VBA

    Can I declare a global array that's available to all modules within the workbook, I tried declaring a variant array as Public but it gave me an error
  6. kelly mort

    modifying a fullscreen userform macro

    I found this code here in this forum which maximizes the userform to cover the whole screen. It worked for me but I have a multi page form and the multi page did not expand. So I wanna know if it can also expand as well. Then what happens to the controls on it. Will they too expand? Option...
  7. S

    Declare variable by choosing file

    Hi Guys, I have a little problem, everytime when I need to run macro the name of files are changed. I want to automatize it maximally as I can and it need to be friendly for newbies. How can I assign name of chosen files to macros using box like below? Need to run twice this box, choose file...
  8. H

    Can not get data from Edit Box of Formula Bar

    Dear: everyone! I want to retrieve data as the data string length in the Formula Bar (the formula bar, rather from its Edit Box) I have used the following 1. Declare Private Declare Function FindWindow Lib "user32" Alias ​​"FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As...
  9. K

    declare dynamic array with 3 columns

    hello i am trying to declare a dynamic array with 3 columns. within a for loop i would like to add to the array so it is unknown how many record elements will be in the array. here is what i have so far which is not working 'declare array Dim final_array() As String 'add records to the...
  10. X

    Declare dll function error

    Hello guys. I'm having trouble tryin to declare a function from a dll, in a test case I'm not bein' able to use a function that i made using visual basic in a dll. Error 453 gets on my way no matter what i do. The code in the VBA on excel is: Declare Function TestReturn Lib "(Path to dll...
  11. L

    Declare correctly a two dimensional dynamic array

    Hi there, I'm stuck with a search / copy macro in Excel. What I am trying to do is to modify a piece of code I used before. I was searching a range in sheet A (wsOut) for an item X and copy the entire line to sheet B (wsIn) if X was found within the range. I did this through an input box. As...
  12. U

    Declare a 2 dimensional array with integers and strings

    I need to declare a two dimensional array that will return the Row and the cell's string value. My only solution is to return the row as a string like this. Public GlobalArray(2, 100) As String Can someone help me get more control than this? Maybe I should just declare it as a variant but this...
  13. B

    Using variable for "libname" in Declare statement for DLL function

    I am trying to declare a dll function in VB6. The syntax for a Declare statement is as follows: [Public | Private] Declare Function name Lib "libname" [Alias "aliasname"] [([arglist])] [As type] I will not know the name of the dll until run time. So, at run time I read the dll name into a...
  14. B

    Array Help Please

    Hello All, I have multiple tables (all the same size) on a worksheet that are filled with rates. I would like to be able to populate a different array for each of these tables. Since there are several tables on the sheet, I am trying to create a Sub routine in a module so that I can simply...
  15. E

    Option Explicit - Declarations

    Hi, Several people on this board have recommended that I alway use Option Explicit in my VB code (via the Tools, Options, Require Variable Declaration option) Firstly, what is the thinking behind this (or what are the implications of not doing this?) Secondly, When I have a lot of code, I...
  16. B

    Declare Multiple Variables for any Open Workbooks

    I have a bunch of Variables that I have in one workbook and I was wondering if I could declare it for the whole application rather than just the project. Example for Main Workbook: Option Explicit Public Shop, Shift, Name as String Sub Add Shop = "Engine" Shift = "Days" Name = "Ted"...

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