const

  1. M

    Can't use Option Explicit and Preprocessor constants together?

    Hello, All, I'm trying to use Option Explicit alongside preprocessor constants, like in the dummy code below: Option Explicit #Const TEST_CONST = 123 Sub TEST_MOD() Debug.Print TEST_CONST End Sub When I try to run TEST_MOD, I get a "Compile Error: Variable not defined." It does the...
  2. W

    Constant expression ?

    Within a macro I have this line Const strFileName = Range("B22").Value When I try to run the macro it gives a warning "constant expression required". Can someone help me with an explanation / solution please?
  3. H

    Const will not accept 2019.2020

    I try to set up Const C As String = 2019.2020 , but the will only accept 2019/202 Please advise on how to overcome this
  4. A

    A further 32 to 64 bit conversion problem

    Hi, I'm using this really cool function in 32 bit Excel. It says I should not alter it.. but even if I try by just adding ptrsafe I can't get it to work. Is there a another similar routine I could use in 64 bit environment? Any help appreciated. Here is the full function. 'This code was...
  5. A

    Cleaning up My Table

    I receive an excel report with a very interesting formating and in trying automate the clean up process of this table. I created the following code to remove the extra headers in the table, the code removes all but one header that starts with "*000*". Here is the code i have: Sub...
  6. L

    VBA Annotate Pivot Table Modification

    I'm working on implementing VBA code that adds a comment column right after a pivot table. The link below on post #108 is the code I'm using, but my question is what part of the code do I modify to have the comment column(s) be 4 columns after my pivot table instead of the column immediately...
  7. N

    Moving files Macro

    Hi, I am still fairly new at coding. I have this macro (not mine, I didn't write it) that works perfectly but I don't want it to copy. I want it to cut and paste the files instead of copying. That way, they no longer exist in the folder from where I moved them from. I have tried to figure it...
  8. 6

    how to see the complete content of floating point numbers

    Const test1 As Single = numero + 500 Const test2 As Single = numero + 800 MsgBox (test1 = test2) It display "False" although test1 and test2 both are shown as "2,147484E+09" in Locals Window. How can I see the complete content of test1 and test2? (eg. in binary code)
  9. S

    Need help with the VBA - Digit to words

    I am very new to VBA and all the codes. I need help with this VBA which I copied from the website or something else I should do. The problem I face: Example: columnA1 - the formula =IF('2018-2019 Semester Data'!U81=0,"",'2018-2019 Semester Data'!U81) The actual data from...
  10. R

    VBA to Close and Save Workbook on Timer

    Hello, I found code in this forum to close my workbook after a certain amount of time, but when I use it, after closing the workbook, it wants to re-open it. Can anyone provide code that works or help me fix this one? Public RunWhen As Double Public Const cRunIntervalSeconds = 300 ' this is...
  11. welshgasman

    Strange behaviour in macro?

    Hi all, I set up a little macro to be able to get to a case quickly in our charity CMS system. Works great when the activity below does not happen. I select a cell with case number. On some occasions cell A1 is selected before trying to go to the website and as that contains the word 'Name' it...
  12. B

    Volume Control - Wave Input Control

    Hello I hope someone one can help: I want to try and achieve a code that will allow the Main volume to stay at Max but turn the Wave Input Volume (Sound from a website/Spotify etc) within the Mixer down individually when I play a sound through Excel. The code I have only turns down the...
  13. M

    Stop .wav file with button after started playing

    So currently I am using this soundme code to play a .wav file #If Win64 Then Private Declare PtrSafe Function PlaySound Lib "winmm.dll" _ Alias "PlaySoundA" (ByVal lpszName As String, _ ByVal hModule As LongPtr, ByVal dwFlags As Long) As Boolean #Else Private Declare...
  14. D

    VBA code Runtime error 91: Object variable or With block variable not set .

    Hi, I am new to VBA coding and I am trying to automate the webpage login process which has username and password but unfortunately the code shows the runtime error-Object variable or With block variable not set. Please help me to solve this case. Please find below the VBA code and source code...
  15. H

    Need to set up a constant

    I have set up a constant as follows Const C As String = .xlsm Sub Open_Fies () Windows("M_ERT Sales(P).xls").Activate Application.Run "'M_ERT Sales (P).xls'!Data_INPUT" ActiveWorkbook.Close Windows("M_ERT Sales (P)" & "C &").Activate ActiveWorkbook.Close Windows("Open...
  16. J

    Code addition

    This may not be the proper forum to ask, so I'll apologize up front, but I am hoping someone may be able to help. I have the following code extracted from a large VBScript. What I'm trying to do is add into this, a macro that was created in an excel sheet, but I am not even sure it can be...
  17. V

    macro cannot find the table??

    Hey there, I have following code like this: Private Sub CommandButton5_Click() Const adOpenKeyset = 1 Const adLockOptimistic = 3 Const WORKSHEETNAME As String = "MIP_solution" Const TABLENAME As String = "Table1" Dim conn As Object, rs As Object Dim tbl As ListObject...
  18. F

    VBA: Change variable within loop for next contant string formula

    I have about 10 Const as String formulas and need to loop thru them column by column. It starts with column 3. The part in Red, need to change in the loop, but can't get the right syntax to change the last digit of the sFormula to grab the next formula for the next column. Sub dkdk()...
  19. L

    VBA Macro to Select from Dropdown (combobox) in Already Open Internet Explorer Tab

    Hello All, I'm hoping someone can help. I amtrying to create a macro using excel that will reference an already openinternet explorer tab and choose from dropdowns (they appear to be comboboxes).If it is relevant, it is an erp site. The website ishttps://ep.erp.navy.mil/irj/portal. I have some...
  20. J

    How to fix a Range

    hi all i have this code: Private Const Chart_Source_Range = "Sheet1!$A$1:$B$9" ' <== Change Chart Source addrs as required Range(Chart_Source_Range).Parent.Select Application.EnableEvents = True Set ws = Range(Chart_Source_Range).Parent Set oLbl =...

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