const

  1. J

    Best way to declare variables for use in all modules?

    Hi, As title, I'm unsure of the correct way to do this as I've seen a few ways. On workbook open ? Public / Const? Example: myVar1 = Sheets("Sheet1").Range("A1").value How can I use myVar1 in all macros without any further declaration Any info appreciated
  2. J

    VBA - Drawing an Arc based on 3D Bubble scatter graph coordinates

    Hi guys I am trying to draw an arc in a 3D bubble scatter plot.I have a code that looks like this Sub insertArc() Dim Arc As Shape Const CenterX = 200 Const CenterY = 200 Const Radius = 10 ActiveSheet.ChartObjects("Chart 15").Activate Set Arc =...
  3. M

    Make cells mandatory ONLY for other users not me as the editor

    I am making cells mandatory to fill before save in excel. however I cannot leave them empty as then it wont let me save the document. i want to be able to save the document with the cells blank but I dont want others to be able to save the form blank. here is my code: Private Sub...
  4. A

    Multiple actions

    Good Evening all, I have this code that a wonderful user gave me some time ago below. The code below allows me to enter a number in A1 and it will show a that number of rows between the first visible row (6) and the last (43). I am hoping there is a way to add multiple actions in this code...
  5. N

    Userform Dynamic created multiple textboxes, change number format after update of value

    Hi, I created multiple Textboxes in a UserForm2 based on a row and values from a worksheet. When a user modify a value in those boxes the format of number is not kept. I would like to keep the number format when user change the value of some of these textboxes but I really dont know how to...
  6. M

    vba Run Time error '-2147221080(800401a8), Method 'Cells' of object'_Workdsheet' Failed

    HI i have below code and it gives "" Run Time error '-2147221080(800401a8), Method 'Cells' of object'_Workdsheet' Failed "" . please guide Private Sub CommandButton1_Click() Dim xlBook As Workbook Dim xlNewBook As Workbook Dim xlSheet As Worksheet Dim LastRow, myrow, lastColumn, rowPointer...
  7. S

    excel send appointment email by button base on today at 2pm,notification period is 10day.

    i am trying to use excel vba to send an email that is included appoiment but it look like got some error.have anyone got this idea? email are require to send out on today at 2pm for notification 10 day. Thanks! Option Explicit Sub Button1_Click() Dim myoutlook As Object Dim myapt As...
  8. A

    Use of code more than once on the same worksheet

    Hi All, I cannot seem to figure out how to get this code to work multiple times on the same Worksheet (I am definitely a beginner when it comes to VBA). So much so, that an awesome member helped out on this forum with the below code to hide and show rows (2-43) based on a number entered into a...
  9. U

    copy and paste row (lookup) to another worksheet

    Currently what this code does is check Column C value in 'Master' sheet and will copy over to matching worksheet name. I would like to improve on this code using sort of lookup feature. I have this new table <tbody> ColA ColB ID1 East ID2 West ID3 North </tbody> If Column C match the...
  10. C

    array problems, setting a limit

    Hi all Im trying to figure out how i can set the max value of an array from a value obtained from another source, like the number of rows in a range for example Public Sub test() 'Const x = 12 Range("e12").Select nld = Range(Selection, Selection.End(xlUp)).Rows.Count y = nld Const x = y...
  11. D

    Assigning Range gives Run-time error '91'

    The line which sets MyRange gives the error with the detail of "Object variable or With block variable not set." I'm hoping that there is simply a typo or something easy I'm missing. And any tips on a better way to do this sort (or if it will even work once I get past the error LOL) would be...
  12. 2

    VBA Query

    Hi, I have a simple piece of code that calculates the mass of a gas at a known pressure within a fixed volume (please see below). However, when I run said code, I get a 'Run-time error '6': Overflow' error. When I scroll the curser across the offending line (i.e. m(1) =...) the last bit in...
  13. A

    Extract sharepoint list to excel

    Hi, I am looking to extract data from a SharePoint . I've got the following code so far but its giving me an error on the underline row as "Run time error 1004 : excel cannot connect to sharepoint list'. Any help? Dim List As ListObject Dim Wksheet As Worksheet Const servStr As String =...
  14. Jaafar Tribak

    Question - Constant to Array function

    Hi dear forum members. Consider the following: Const MyConst = "A" & "B" & "C" & "D" Sub Test() Dim Myarray() As Variant Myarray = Array(MyConst) Debug.Print Myarray(0); Myarray(1); Myarray(2); Myarray(3) End Sub Of course, the above code won't work but you get the idea ...
  15. S

    VBA code to Import data from 2nd Tab

    Hi VBA code is only taking the data from the 1st tab and importing. How do I ask it to import the data from the 2nd tab. The aim is to have 2 tabs with different data. Here is the first part of the code for the 1st tab: Public Sub ImportPayment_Details() Const ACCOUNT_NAME = "ACCOUNT_NAME"...
  16. M

    not pasting

    Hi Guys Can someone please urgently help. Why this code isnt pasting in another workbook. it doesnt show any error, but doesnt post either. (pasting code is the fourth line from bottom). Thanks so much Sub SplitData() Const NameCol = "c" Const HeaderRow = 1 Const HeaderRow2...
  17. M

    A problem with a macro for Excel 2016 for Mac (from a french teacher)

    Hello guys I’m not a very good user of Excel on Mac and i’m an occasional teacher. For many long time, I use a macro called « Stataix » withe help me to draw dot plot graphic. I know it’s inside Excel’16 now but I can do some thing with this macro I can’t do usually with the new version of...
  18. L

    how to loop reminder program in excel until esc key is pressed

    i have created an excel program to alert my works in office.Its alarm is ringing when it reaches the given time.but i need to stop this alarm when i pressed esc key.please help me with this.i'm not a programmer or related in that field.Here are my codes Thank you by lakmal #If Win64 Then...
  19. Lensmeister

    Record changes to Excel File

    Morning all, I have worksheet with about 50+ sheets that is on our server. I need to be able to see who changed what cell and on what sheet and when. I found this code on here: Option Explicit Const intUsernameColumn = 1 Const intCellRefColumn = 2 Const intNewValueColumn = 3 Const...
  20. F

    VBA Code to login into a Website

    Hello, I am having problems logging into a Wells Fargo website. I've tried using codes from this forum but I cannot get my info to entered into the boxes. This is the website and the code i am using... Option Explicit Const MyUserID As String = "123701" Const MyUserName As String = "sdf12345"...

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