boolean

  1. T

    Boolean set first cell check if data then got to next cell

    Hello, I would like to find the code to set a start cell to check if there is a number in it, if not check next cell in the row? Example sometimes the source data is in BL3 and others its BK3. so if I can set a short loop it might solve an issue. ws2.Range("A1").Value = ws1.Range("BL3").Value...
  2. T

    Image in Footer via VBA

    Hey guys, I hope you can assist me... I am trying to protect a document by having a particular footer appear every time a person saves. I have to make multiple versions of the document for different people and am battling to the get the image to change per saved version. I, by the stroke of...
  3. L

    If cell is Empty!

    Hi all, I am trying to check for all sheets if specific call E10 is empty and it prevents user from saving. Currently it is only working on the sheet that i am on. It does not work on the others, i want to make it that it checks all check for a specific cell before saving. This is currently...
  4. L

    example using boolean

    Hi I understand how boolean variables work. However, I am looking for a simple code that use boolean to understand it better or to see how it is used really. I created the code below but to me that does not make a lot of sense, I have seen this example on the net. Sub myboolean() Dim...
  5. F

    VBA: Add period to end of sentence

    This works well, but curios, can this be done without looping? Such as with Evaluate? SubAddPeriod() Dim c As Range For Each c In Range("C8",Range("C" & Rows.Count).End(xlUp)) If PeriodExists(c) <> True Then If Len(c) > 0 And Right(c, 1)<> "." Then c = c & "."...
  6. B

    Return Multiple Values from IF Statement

    Hi Commnity, I have a formula I am trying to compile to return to me with who's anniversay date it is from a range of employees and their corresponding hire dates. I know that a IF statement generally works to find the first TRUE logical evaluation and then stops, but if there are multiple...
  7. B

    Easy VBA Loop Through Variables Looking for Boolean Flag

    Hi All, I'm attempting to write a code that looks through a potential of 50 different Boolean variables and creates a new variable "YES" if at least one is flagged yes. I am extremely new to VBA and just know basic loops. Any help would be appreciated. Thank!
  8. M

    Infinite save prompt loop on close

    I'm using the following macro to suppress messages about there being things within the workbook that the document inspector can't remove. It works but when closing the file it enters an infinite loop of saving and then prompting me if I want to save changes. How could I exit this loop after...
  9. Dazzawm

    Change Part Of Before Save Code In Bulk?

    I have loads of files that have a before save code within them. I need to change the location, is it possible to change part of the code without opening them all individually? This is the code Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If...
  10. C

    More convenient way to return text with Boolean?

    I’m trying to avoid lengthy IF() formulas by using Boolean operators. Is the a more convenient way to return a text string from a cell based on a True/False result that doesn’t involve an IF function? Numbers are easy because you just multiply them by the true/false result.
  11. P

    Update UDF for Win 10

    Hi folks I have a simple UDF just to compare text files and highlight any lines between the two that do not match, it simply runs the basic DOS file compare function but just simplifies the usage. Just had my work pc upgraded to Win 10 (Yep... just), and now find that this doesn't work any more...
  12. R

    OptionButton: Boolean vs Long, and why -4146?

    Hi Folks, I've been doing some reading up on the Multiple UserForm Controls with One Event Handler concept, and a few questions have arisen... :confused: Some (most?) of the articles I've read talk about using Long variables vs. Boolean to hold the value of OptionButtons & CheckBoxes. The...
  13. J

    Best Practices When Coding Multiple Buttons Performing Similar Actions

    Wowza, Wasn’t sure what was the best way to word my question. I’m currently working on a code that transfers dates from an excel sheet into a webform and selects a specific export button on the website (just pulling reports essentially). Each button pulls a specific report. So there’s a need...
  14. JenniferMurphy

    Boolean values are numbers sometimes?

    It appears that Boolean values (TRUE, FALSE) can be used in calculations in some situations, but not others. In this table, Col D shows the formula in Col C. <tbody> R/C C D 4 FALSE C4: FALSE 5 TRUE C5: TRUE 6 TRUE C6: TRUE 7 #DIV/0! C7: =AVERAGE(C4:C6) 8 0 C8: =SUM(C4:C6) 9 2 C9...
  15. W

    Prevent saving workbook

    So I thought if I placed this code into the Workbook Module it would prevent the workbook from being saved or saved as. What did I miss? Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Application.DisplayAlerts = False ThisWorkbook.Saved = True...
  16. K

    Boolean test for dependency between 2 cells

    How can I test whether one cell is dependent on another? I tried the following, but does not seem to work: Function Depends(Cell_B As Range, Cell_A As Range) As Boolean If Not Intersect(Cell_B, Cell_A.Dependents) Is Nothing Then Depends = True Else Depends = False End Function
  17. D

    BeforeSave VBA to move sheet "Done" to new workbook

    We have a workbook, "followup_care.xlsm", in which data is moved to sheet "Done" and we like to move sheet "Done" to a new workbook ,saved with the date in the new workbook name, and both workbooks save and close. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, cancel As Boolean)...
  18. D

    VBA do not allow to save if row count does not match

    Hi, I am looking for a code that would prevent user from saving the file if count of no empty cells in column "E" is different than in columns "F"-"AE" Any ideas?? I tried with below but failed Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If...
  19. C

    Multiple cells to open one userform

    Still relatively new to coding. I'm trying to build an equipment schedule so I know where gear is going/has been. I'm trying to set it up so I can double click the piece of equipment which will in turn run a user form. It works for my first line (A3), but not for anything after. Private Sub...
  20. S

    How to create a Boolean strings in excel with VBA Macro

    Hi Friends, I tried with a formula creating Boolean strings but its time consuming every time. This is an example: In Column, AI have list of words from A1:A50, It varies every time from A1:A50. ColumnB AND words ColumnC NOT words Here I want to build Boolean strings in ColumnD. In ColumnD...

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top