macros and vba
6524 TopicsTRES URGENT
Bonjour Le clic droit de la souris ne fonctionne plus sous Excel. Qui peut m’aider à le réparer ? MerciSolved3.2KViews0likes7CommentsExcel Tools for Network & Windows
Excel Tools for Network & Windows Some time ago I already shared an earlier version of this project. Since then, I have added several new features. These tools are based on functionalities that already exist in Windows and its associated software. I have consolidated them into a single Excel-based interface, allowing all tools to be executed directly from Excel. The files are free for private use. For business or enterprise environments, a more comprehensive toolbox can be developed, enabling direct support, repair, management, monitoring, and control of users and systems. Everything can be customized according to specific requirements — the scope depends solely on the desired functionality, time investment, and budget. I appreciate any positive feedback, suggestions, or constructive tips. If this project is not of interest to you, please feel free to ignore it. Thank you, and I wish everyone happy holidays.40Views1like2CommentsFinding time duration between a start date & time with end date & time
Hi all! I'm looking for any formula or power query to calculate a total time duration within a day, given the start date, start time, end date, end time. Most of the dates will equal the same but there are some with the end date being the next day. I'd like to be able to exclude any overlaps as well. Currently, I have a large embedded IF formula: =IF(AND($G4=$O4,$H4<$H5,$P4>=$H5,$P4<$P5,$H4<$H3),$P4-$H4,IF(AND($G4=$O4,$G4>$G3,$H4<$H3,$P4<$P3,$H4<$P3,$P4<$P5),$P4-$H4,IF(AND($G4=$O4,$H4>$H3,$H4>=$P3,$P4>$P3),$P4-$H4,IF(AND($G4=$O4,$H4=$P4),0,IF(AND($G4=$O4,$H4<$P3,$P4<=$P3),0,IF(AND($G4<$O4,$H4<$P3,$P4>$H4),($P4+1)-$P3,IF(AND($G4=$O4,$O4<$G5,$O4<$O5,$H4<$P3,$P4>$P3),$P4-$P3,IF(AND($G4=$O4,$G4>$G3,$H4>$H3,$P4>$P3,$H4>$P3),$P4-$H4,IF(AND($G4=$O4,$G4<$O5,$P4>$P3,$P4>$H5,$H4>$H3,$H4<$H5),0,IF(AND($G4=$O4,$O4=$G5,$H4<$P3,$P4>$H5,$P4>$P3,$P4>$P5,$P2>$P3),$P4-$P2,IF(AND($G4=$O4,$H4<$P3,$P4>$P3,$P4>$P5),$P4-$P3,IF(AND($G4=$O4,$H4<$P3,$P4>$P3,$H4<$H5,$P4<$P5),$P4-$P3,IF(AND($G4=$O4,$H4<$H5,$H4<$P3,$P4>$P3,$P4>$P5),$P4-$P3,IF(AND($G4=$O4,$O4=$G5,$H4<$P3,$P4>$H5,$P4>$P3),$P4-$P2,IF(AND(ISBLANK($O4),ISBLANK($P4)),0,IF(AND($G4<$O4,$H4<$P3,$P4<$H4),($P4+1)-$P3)))))))))))))))) This seems to work for the most part but there are a few that I just can't get. I also pulled up my query and started to enter in the time durations manually and it couldnt come up with anything automatic for me. There must be an easier way for me to do this other than trying to create an IF formula for each answer that turns up incorrect. I have a screen shot below.159Views0likes4CommentsInitializing TextBoxes within a UserForm
My spreadsheet contains a macro which utilizes two UserForms, each containing several TextBoxes. I want to initialize several TextBoxes in each Userform. One UserForm works and the other one does not, even though I have set the code up identically in each one. Here is what I have detected: When you step through the macro code (F8), when the first UserForm.Show statement is executed, the control skips to the first line of code for the UserForm and when the second UserForm.Show is executed, the control skips to the first TextBox on the Object. Here is a sample of the code I am using: Private Sub UserForm1() TextBox1.Value = "ABCDE" End Sub I have been writing macros like this for over 30 years, but this is the first time I have run into this situation. Any help here will be greatly appreciated. Al77Views0likes4CommentsLearning Macro Control Buttons
My goal is to embed two control buttons that pop up when a certain range of cells is selected. I have two columns (C:D) that have numeric entries for quantities of items. I want to be able to select a cell in this range and have two buttons appear next to active cell, one to add by an input value and one to subtract by an input value. I was able to create Form Control Buttons that can do the task but I can't figure out how to align them to the active cell and hide them if the active cell is outside of the desired range. Any suggestions? Do I need to use ActiveX buttons instead of Form Control?117Views1like1CommentTrying to insert Pivot Table
I recorded a new macro, using the tab View Macros-Record Macro, which resulted in the following VBA code: Sub CreatePivotTable() Sheets("Year Data").Select Range("A3:F24").Select ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "Year Data!R3C1:R24C6", Version:=xlPivotTableVersion14).CreatePivotTable _ TableDestination:="Yearly Summary!R3C1", TableName:="PivotTable3", _ DefaultVersion:=xlPivotTableVersion14 Sheets("Yearly Summary").Select Cells(3, 1).Select End Sub The recording did exactly as I wanted, taking the data from the "Year Data" WS and adding the new pivot table to the "Yearly Summary" WS. As a test of the macro, I deleted the initial pivot table that was created on the "Yearly Summary" WS. The problem I have now, when I attempt to run this macro again it constantly fails on the 4th line of the macro with Run-time error '5': Invalid procedure call or argument. ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "Year Data!R3C1:R24C6", Version:=xlPivotTableVersion14).CreatePivotTable _ TableDestination:="Yearly Summary!R3C1", TableName:="PivotTable3", _ DefaultVersion:=xlPivotTableVersion14 I cannot figure out why it works when I am recording the macro but fails when I try to run it alone. Help is greatly appreciated.Solved113Views0likes2CommentsDate of Last Modified for a Cell
Good day, all. I am inquiring if there is an excel function that would give me a date (and time) that an individual cell was last modified. For example: cell A2 has an entry of $2.55 and I'd like cell A3 to read "12/5/22 at 10am". a week later I change the $2.55 to $3.00....I'd like the A3 cell to read "12/12/22 at 10:30am". I've seen some VBA solutions but wondering if there is a simple excel formula to accomplish this?278KViews4likes82CommentsHow to get all possible permutation in VBA
Hi, We all know Benjamin Franklins Square. How can I Get VBA to export a spreadsheet with all possible permutations for numbers 1-9. Filter out duplicates of the same number Filter out only combinations that the sum matches the criteria below First 3 digits = 15 Second 3 digits = 15 Third 3 digits = 15 1st, 4th, 7th = 15 2nd, 5th, 8th = 15 3rd, 6th, 9th = 15 1st, 5th, 9th = 15 3rd, 5th, 7th = 15 I hope you are following what I'm trying to do. Thanks in advance, Uncle BearSolved195Views0likes5Comments