boolean

  1. M

    Changing cell color in a range of cells

    Hello, I have figured out the VBA formula to change cell color when double click, right click etc... however, i only want it to this on a specific section of the worksheet and not the whole worksheet. Here is what i entered in the VBA Private Sub Worksheet_BeforeDoubleClick(ByVal Target As...
  2. B

    Optimize dynamic creation of labels and their click events.

    So my code allows to create a label dynamically (CreateLabel Sub) and dynamically remove labels (RemoveControls Sub) and the class module allows for the click event to occur for these dynamically created labels. The thing is I am using both collection and arrays to make this happen but I feel as...
  3. B

    reformat name

    I have a macro that returns the user's name in this format:"Doe, John". What I want is to be formatted like:"John Doe". Here is the macro I am working with. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim ws As Worksheet Set ws = ActiveSheet With...
  4. D

    ActiveChart does not work when running a batch. How to solve it?

    Hi Guys, I am having difficulty running a small report via Task Scheduler. It works fine updating form the database but this last code gives me a headache. The error says: "Run-time error '91': Object cariable or With block varible not set I know its the highligthed with red color, but just...
  5. D

    Prevent save as with VBA

    <code>Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "You can't save this workbook!" Cancel = True End Sub I can't seem to prevent the user from saving as and creating a new workbook, and yet still allow them to save the workbook regularly. </code>
  6. M

    VBA code to re-protect sheets of the workbook upon close and save that will also allow auto-filters to work

    I am new to MrExcel and new to VBA and hope you will help me. I used the following code to protect my workbook sheets before close and upon save and it works great but I can't figure out how to write it to allow filters to still work on all tabs of the workbook when protected. There are...
  7. L

    VBA Frustration

    I inherited a project from an ex-coworker and part of it involves an Excel workbook with a VBA code. I am only just learning VBA and out IT department is useless so I figured I’d try here. I’ve been able to fix most of the compile errors but these 2 errors persist and I can’t figure out how to...
  8. L

    VBA Troubles

    I inherited a project from a ex-coworker and part of it involves Excel with a VBA code. I am not well versed in VBA...actually not versed at all and our IT department is useless so I figured I'd try a forum to see if anyone could help. I continue to get error messages from the code and no matter...
  9. H

    Boolean True/False values not recognised in Countifs formula

    Hi, I am running an SQL statement query via Azure directly into Excel. The data is from Salesforce and some of the columns contain Boolean values shown as true or false (left aligned all lower case). An example of the data set is below: Salesman Converted Date Fred...
  10. C

    VBA Modifcation

    Good afternoon, Could someone possibly help with amending the VBA below as our VBA guru has left our company. All I need the amendment to be is in Column J add the comment "To be updated" (from cell J2 onwards for each row where there is data in the prior column) Thank you Private Sub...
  11. K

    Validate

    Why wont this script color the column M if it meets both criteria: Sub Validate() Dim found As Boolean found = False For Each cell In Range("F2:M1000").Cells If cell.Value = "FT Hourly" And "<40" Then found = True End If Next If found = True Then...
  12. T

    BeforeSave Crashing When Closing Workbook

    Hi all, If I save my workbook during my session the below code works perfectly, refreshing the query quietly in the background. The problem I am facing is that when I am prompted to save on close the macro will start running (I can see that it starts because of the "retrieving data" status...
  13. S

    VBA code that will comment out other vba code?

    So I've got a worbook made for others to use that has the "save" disabled, to preserve the workbook. I'd like to make a button or something that will open the 'save as' command but also comment out/disable the 'save disable' code, that way, they can save-as a new file in their own folder and...
  14. A

    Automatically Email worksheet when saved

    Hi all I hope you can help me, I have managed to make my workbook automatically send an email when the workbook is saved using the code below, however the only problem is that the selection on the email is massize and spreads across 2-3 pages, meaning that it can not be printed, can I add...
  15. J

    Overwrite msgbox Yes/No issue

    Hello I am in need of your help, I am trying to add a message box popup in VBA that when a user selects file>save or ctrl+s, it prompts them with a message box that states "Do you really want to overwrite this file?" Yes button to continue to save, No button to cancel and close the message box...
  16. B

    I need help with Boolean

    Sub isempty() Dim i As Integer Dim LastRow As Range LastRow = Range("A65536").End(xlUp).Row For i = 1 To LastRow If isempty(cells(i, 1)) Then cells(i, 1).Resize(1, 4).Interior.ColorIndex = 1 End If Next i End Sub is empty is a boolean function Here is the attachment link...
  17. S

    COUNTIF = "True" as string, not boolean

    I run a report from our HR system that outputs a True/False column as a string (verified using =TYPE() formula). When attempting to do the countif formula below on the column it does not count them: =COUNTIF(TermList[Is Voluntary?],"False") It works when I change the column to a Boolean and...
  18. P

    Get the value of a Boolean variable by passing its name as text

    I would like to Get the value of a Boolean variable by passing its name as text. The following line works for me in another file lablnam = Me.Controls(StrArrOptBtnLblNam(ctra, 1)).Caption Is there an equivalent as the above or something else to get value of variables using the names of the...
  19. R

    Trouble with a boolean statement using textbox value

    Greetings ~ I am trying to create a Boolean condition with the value of a textbox which has its value expressed in "hh:mm:ss" format. Below is the conditional statement which simply will not read correctly If Format(.TextBox74.Text, "hh:mm:ss") > "3:00" Then .TextBox74.BackColor =...
  20. B

    Referencing a Shared Calendar

    Hi Guys, I was just wondering if anyone knows how to reference a shared calendar location in the below code. the location i am trying to reference is "\UK Public Folders\Customer Services\UK Customer Services Calendar" Sub CreateOutlookAppointment() Dim strCategory As String, strTopic As...

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