Macros and VBA
6356 TopicsImport Tab Delimited File from Clipboard
I'm looking to create a macro in excel to import a file from clipboard. I have tried to record a macro and that did not work. I do not want to enter a file name. I would like to copy from notepad and execute macro to import the data with pipe delimits. Sorry if this is a repeat, I ould not fine an answr anywhere. Thanks.Solved51Views0likes4CommentsHow to access temp selection?
Hi, is there a way to determine the temporary selection address from vba? The steps to reproduce are as follows: Select cells [A1:A3]. Hold the right mouse button and drag the selection and move to A10, now release the right mouse button and I have a temporary drag and drop area of [A1:A10]. However it is not the current selection (the result from Application.Selection is still "A1:A3") Thanks you!Solved49Views0likes2CommentsConcatenating two lists of numbers of different lengths
I am attempting to concatenate two lists of numbers of differing lengths. Unfortunately, I am extremely new to this, so any help provided would be greatly appreciated. In one list I have from 001 to 365 and in the other list I have 1 to 10. For each number from 001 to 365, I need them to have 10 iterations. I hope the image below explains it better. How can this be accomplished in VBA?32Views0likes2CommentsPreventing the user from going to the next page in UserFrom
Hello , like the title says I have a problem in the UserForm.When the fields are blank in the first page(employee) then if the user clicks on the second page (training) , the message should pop-up and the user should stay on the first page.However, it looks like it stays on the first page but the controls(fields) of the second page (training) are visible , so only the page tab reverts back as employee but the fields are from the training page.Where is the mistake ? I would appreciate the answer ! Screenshots : Before clicking the training(2.page) when all fields are empty: after clicking training page: after closing the message : The code: Private Sub MultiPage1_Change() Dim isValid As Boolean isValid = True ' When trying to navigate to Page 2 (Training), validate fields first If MultiPage1.Value = 1 Then isValid = ValidateFields() If Not isValid Then MsgBox "Please complete all employee fields before proceeding to the Training page." MultiPage1.Value = 0 End If ' Load the training list now that we're accessing Page 2 Call LoadTrainingList("") End If End Sub Private Function ValidateFields() As Boolean ' Initially assume all fields are valid ValidateFields = True ' Check name field If Me.txtName.Value = "" Then Me.txtName.BackColor = RGB(255, 200, 200) ' Light red for missing data ValidateFields = False Else Me.txtName.BackColor = RGB(255, 255, 255) ' Reset back color if correct End If ' Check role field If Me.txtRole.Value = "" Then Me.txtRole.BackColor = RGB(255, 200, 200) ValidateFields = False Else Me.txtRole.BackColor = RGB(255, 255, 255) End If ' Check ID field If Me.txtID.Value = "" Then Me.txtID.BackColor = RGB(255, 200, 200) ValidateFields = False Else Me.txtID.BackColor = RGB(255, 255, 255) End If ' Check section field If Me.txtSection.Value = "" Then Me.txtSection.BackColor = RGB(255, 200, 200) ValidateFields = False Else Me.txtSection.BackColor = RGB(255, 255, 255) End If End Function Private Sub UserForm_Initialize() ' Set the initial page to Employee (Page1, assuming index 0) MultiPage1.Value = 0 ' Ensure all relevant controls are reset or visible/invisible as needed ResetFieldColors ' Start/resetting particular fields or visibility information here if required End Sub17Views0likes2CommentsHow to stop excel from updating dates.
Hi there, I have a running order list that we keep track of what is ordered when and when things are received. we are using a check box to initiate when the item was received. my problem is that the when i go to update an item the previous dates update to the current date. How can i prevent the date in column H from updating to keep historical dates? example of the document and the formula i am using. thank you in advance106Views0likes8CommentsDax to find open status for more than 1 hour
Hi Team, I have the below table: Here I want to find that whether door is being open for more than 1 hour or not. The Status column shows whether door is open or not. CreatedOn column shows time duration. Could you please help me create a dax logic to achieve this? PFA file here B&M.pbix Thanks in advance! SergeiBaklanSolved76Views0likes5CommentsWhat causes an excel file to 'Show Print Preview' rather than show the preview by default.
I am curious what causes this to happen, I have already set the print area etc., but for some reason I don't get an immediate preview when going to print, I have to click this button inside the print preview. (I have also attached the full screenshot Doesn't seem to matter what settings I change so far, just curious what exactly causes this change in excel, I have many other documents that just bring up the preview straight away when going to print, but at the moment, this one particular file I have to click another button. I have a MS flow that converts excel files to pdf automatically after a review process, but it keeps failing on this one file and I can't figure out why, but I think the key revolves around this, so I really want to find out what causes excel to present an additional button that you have to click to generate a preview rather than showing the preview off the bat like it does with every other file which works fine in the flow. ThankyouSolved85Views0likes5CommentsRuntime error popup hiding in Mission Control - not accessible
Hi I'm running Excel and VBA on a Mac with a couple of screens. If I receive any type of Runtime error popup, it does not appear on either of the screens as an overlay on my worksheet or VBE. I can locate the runtime message by pressing the Mission control key F3 and select the message by clicking the mouse on it or pressing space. However, none of the buttons (End, Debug etc) are functional when clicking on them. The box just minimises and I'm stuck on the error. How do I take control of the box and progress by acknowledging the error? Esc doesn't work here either.3.8KViews1like7CommentsErreur référence cellule MACRO/VBA
Bonjour à tous, Je travaille actuellement sur un projet de récapitulatif des congés pris par mes salariés. J'ai utilisé des formules et macro pour automatiser mes calculs, cependant, si les "périodes de congés" sont vides, une erreur s'affiche et bloque toutes les autres formules. Le tableau est mit à jour tout au long de l'année et j'ai besoin qu'il soit utilisable sans cette vilaine erreur "#REF!". Pourriez-vous m'aider ? Voici les infos techniques : 2 feuilles : "Contrat Initial" : feuille du tableau "MACRO" : feuille de données, calendriers des jours fériés etc. Formules utilisées : Total des jours hors jours fériés J'ai besoin d'afficher le nombre de jours ouvrables (lundi à samedi) hors jours fériés Calcul des samedis sur la période J'ai besoin d'afficher le nombre de samedis sur la période de congés saisie. Samedi est défini comme le 6ème jour de ma semaine, selon le système européen. Le calendrier J'ai saisi les données des jours fériés sur la feuille "MACRO" sur la plage A12:F22 Merci d'avance de votre aide !Solved28Views0likes2CommentsVBA questions about listing in one cell
Hello, I am new in using VBA in Excel. I have three related questions: - How can I write in one cell in excel file the names for many excel files at one folder? - How can I arrange and list the names in the cell? - How can I repeat the task in a different cell at the same excel but for different folder files? Thanks22Views0likes1Comment