Excel Macro Mania

Excel Macro Mania

Everything's possible in Excel. Come along to learn Excel VBA and create amazing macros with me here.

Пікірлер

  • @rodrigolisboanascimento8794
    @rodrigolisboanascimento8794Күн бұрын

    Very good

  • @proxyhn
    @proxyhn3 күн бұрын

    How would one code this using typescript in excel?

  • @ExcelMacroMania
    @ExcelMacroManiaКүн бұрын

    I've never used a typescript library for Excel, but there's one for JavaScript. However, I don't know why you want to do that. If you create a macro in Excel use VBA, if you create a web app, use JavaScript or TypeScript or any other.

  • @proxyhn
    @proxyhn5 сағат бұрын

    @@ExcelMacroManiathank you so much It worked! Just another question would you happen to know about how I could format the body text to add images and such

  • @user-wc2jk4pr2g
    @user-wc2jk4pr2g3 күн бұрын

    Thanks for the excellent tutorial. If my table contains, for example, 50 recipients, but currently through filtering it is required to send to only 8 recipients scattered in different and non-consecutive rows in the table (the other rows "disappear" temporarily in the filtering), is the loop you presented still correct to use? Will the Ir automatically skip those lines that were hidden in the filter or is another setting required?

  • @ExcelMacroMania
    @ExcelMacroManiaКүн бұрын

    You can use the same loop and a condition to check if the row is hidden or use a for each loop along special cells: For Each sheetRow In ActiveSheet.UsedRange.SpecialCells(xlCellTypeVisible).Rows ... Next sheetRow

  • @GrayYeonMath
    @GrayYeonMath4 күн бұрын

    How can I make different levels, easy, medium and difficult?

  • @ExcelMacroMania
    @ExcelMacroManiaКүн бұрын

    You keep removing numbers from the fully-filled grid (if you use decremental generation like in this video) following strategies that target certain positions and ensure the solution stays always unique. Check this article to read more about it: excelmacrofun.blogspot.com/2022/03/excel-sudoku-generation-techniques.html You can also check out this book to learn all the details about generating and solving Sudoku with Excel VBA: excelmacrofun.blogspot.com/p/sudoku-excel-macros.html

  • @aleksmaric5159
    @aleksmaric51595 күн бұрын

    Hello, I tried to run code after been watching the part 2/2 web scraping but it doesn't work, I got message compile error, user-defined type is not define.How to fix the problem>

  • @ExcelMacroMania
    @ExcelMacroManiaКүн бұрын

    You have probably miss-typed some variable/object. Check the code to make sure it's correct: excelmacroclass.blogspot.com/2022/04/scrape-web-data-excel-vba-macro-part-1.html excelmacroclass.blogspot.com/2022/05/scrape-web-data-excel-vba-macro-part-2.html

  • @JellySlab
    @JellySlab5 күн бұрын

    I have a data set where i am filtering a column that has integer values between 1-10. The output is 9 sheets that are properly filtered and copies, but filtered data with a value of 1 was not properly copied to a new sheet. Note that for this code to work i had to set my filter parameter ("position") to integer because if I set it to string i ended up with the 10 properly copied filtered data sheets and extra blank sheets that totaled the number of rows in the original unfiltered data set. Please help! Sub Macro1312() Dim r As Integer, sheetname As String, position As Integer, ws As Worksheet Set ws =ActiveSheet Ws.Range("A1:K1").AutoFilter r=1 Do r = r + 1 position = ws.Range("J" & r).Value On Error Resume Next If Sheets(position) Is Nothing Then ws.Range("A1:K1").AutoFilter Field:=1, Criteria1:="INST Var." ws.Range("A1:K1").AutoFilter Field:=4, Criteria1:="BC" ws.Range("A1:K1").AutoFilter Field:=8, Criteria1:="Dynamic" ws.Range("A1:K1").AutoFilter Field:=10, Criteria1:=position ws.Range("J1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy sheetname = "INST_BC_DYN_" & position Sheets.Add.Name = sheetname Sheets(sheetname).Paste .ShowAllData End If Loop While ws.Range("J" & r + 1).Value <> "" End Sub

  • @ExcelMacroMania
    @ExcelMacroManiaКүн бұрын

    Try using a For loop with specific start and end row instead of Do loop. Also make sure you start in row 2 if you have headers.

  • @nadermounir8228
    @nadermounir82285 күн бұрын

    Thank you for this great video. Getting the last row is an important topic in VBA

  • @user-wc2jk4pr2g
    @user-wc2jk4pr2g6 күн бұрын

    Hello I wrote the code for sending multiple emails in accordance with your great video. I wrote: Dim OutApp as new outlook. Application By clicking on send button I got a message: Compile error User defined type not defined. Please advise

  • @ExcelMacroMania
    @ExcelMacroManiaКүн бұрын

    User define type not defined usually means that you wrote some variable/object that Excel cannot understand because it has not been defined before. You should look at the yellow line of the compile error. It could be you didn't add the Outlook library to the references, but also that you mistyped some variable/object, so double-check the code here: excelmacroclass.blogspot.com/2023/05/send-multiple-emails-from-excel-vba.html

  • @RILEX_N1
    @RILEX_N16 күн бұрын

    7:24

  • @thisistamal
    @thisistamal7 күн бұрын

    Sir, not able to use this code once I am saving this in module under personal macro workbook and apply for other open workbook. Any solution to this?

  • @ExcelMacroMania
    @ExcelMacroManiaКүн бұрын

    The macro will run for the active workbook unless otherwise specified. Learn how to target the active workbook vs ThisWorkbook, or to specifically reference a workbook in this other video: kzread.info/dash/bejne/pIKlw65mesqoqLg.htmlsi=Cf2MsePgT9OCJA_Z

  • @its10rdvarys
    @its10rdvarys8 күн бұрын

    maybe bc my excel version is new maybe the file version is old bc your video published 1 year ago so some function might not work

  • @vikaspandey3789
    @vikaspandey37899 күн бұрын

    Sir can you please help me with code - Object is i need to reconcile to data between two files using unique id.

  • @ExcelMacroMania
    @ExcelMacroMania7 күн бұрын

    For that check this other video: kzread.info/dash/bejne/imp_tqWuoczAf7g.htmlsi=uWfvsWks3eXP9mQS

  • @davidbarnes1360
    @davidbarnes13609 күн бұрын

    Kelly Roland was close

  • @its10rdvarys
    @its10rdvarys9 күн бұрын

    it's not working too I tried to download the file and then launch it on Microsoft excel it says does not support

  • @ExcelMacroMania
    @ExcelMacroMania9 күн бұрын

    It works. Many people have downloaded and had no issues. What is not supported? which line is highlighted with the error?

  • @flance4011
    @flance401110 күн бұрын

    Works perfectly. Thx. Is it possile to insert the signature stored in outlook?

  • @ExcelMacroMania
    @ExcelMacroMania9 күн бұрын

    Yes, you can do that if you first display the email body to get the signature as HTMLBody and then concatenate that with the body you want to add, all as HTMLbody - see below: With OutMail .Display signature = .HTMLBody .To = "[email protected]" .Subject = "email subject" body = "Dear Customer,... bla bla" .HTMLBody = body & signature '.Send 'uncomment to send End With

  • @Roberto-live
    @Roberto-live10 күн бұрын

    Great video!

  • @raghumahadeva3013
    @raghumahadeva301310 күн бұрын

    Hi Sir, Thanks for the explanation. it's really very helpfull for me. I have 2 questions 1. how to send table - How can I select range for table 2. how can I send 1st sheet of excel via mail Thanks for your support

  • @ExcelMacroMania
    @ExcelMacroMania10 күн бұрын

    1. Check this other video to see how to convert range to html and put it in a variable (e.g. rangehtml). Then you have to add html with OutMail.HTMLBody = rangehtml. Here's the video: kzread.info/dash/bejne/e5qXlKtvp9C9ec4.htmlsi=LU_Yci_g5bt6E6rA 2. You can use UsedRange to get the range in that sheet and then convert it to html as per point 1. If you have more things in the sheet such as charts, shapes, etc, that you want to send via email, is more complicated and you would need to loop through objects and maybe save as picture and send as attachment or also in the html with <img src = "....">... there are many options there.

  • @raghumahadeva3013
    @raghumahadeva30137 күн бұрын

    @@ExcelMacroMania Hi Sir, Thanks for your support. I just started learning VBI macro. I have one request from my team. I need to do automation using Excel macro. could you please support on this ? I can pay money for the support. Thank you.

  • @ExcelMacroMania
    @ExcelMacroMania7 күн бұрын

    @@raghumahadeva3013 Unfortunately I do not have time to do support or do any other jobs. You can find VBA experts in freelancer, upwork, etc. You can also learn quickly following my tutorials here in the channel (start with tutorial for beginners playlist), and in my blogs: excelmacroclass.blogspot.com/

  • @raghumahadeva3013
    @raghumahadeva30137 күн бұрын

    @@ExcelMacroMania okay sir. Thanks for your valuable inputs.

  • @user-wc2jk4pr2g
    @user-wc2jk4pr2g10 күн бұрын

    Hello, thanks for the great video and instructions. I have 2 questions: 1. How do you align the raw to the right or left? 2. How do you separate between sentences in the body, so each one of them will start in a new raw. Thanks for your support.

  • @ExcelMacroMania
    @ExcelMacroMania10 күн бұрын

    1. To align content in the email you need to use HTMLBody property instead of just Body. Then you need to have the html alone or with css to align the content. For example: OutMail.HTMLBody = "<html><body><p align="left">" & htmlbody1 & "</p>" & .... 2. If you use HTMLBody as above in point 1, you can just add the break as htlml ("<br>"). If you use Body you can use vbLf as follows: OutMail.Body = bodyHeader & vbLf & vbLf & bodyMain & vbLf & vbLf & bodySignature

  • @user-wc2jk4pr2g
    @user-wc2jk4pr2g10 күн бұрын

    Thanks for your help and kindness. I wrote the Macro but from some reason the emails haven’t been sent. What have I done wrong? Can I send you a screenshot?

  • @ExcelMacroMania
    @ExcelMacroMania9 күн бұрын

    @@user-wc2jk4pr2g But were they sent before? You just changed HTMLBody? where do you get the error? Check your code is correct comparing with macros here: excelmacrobusiness.blogspot.com/2024/02/excel-email-management.html

  • @user-wc2jk4pr2g
    @user-wc2jk4pr2g9 күн бұрын

    I don’t get error. I push the “send” button, it gives the feeling that emails were sent but there is no sign foe emails sent or received.

  • @syedfaiyaz346
    @syedfaiyaz34611 күн бұрын

    9:31 compile error User- defined type not defined This error is coming

  • @ExcelMacroMania
    @ExcelMacroMania10 күн бұрын

    That's probably because you miss-typed some of the objects/variables. Check the correct code here: excelmacroclass.blogspot.com/2023/05/send-multiple-emails-from-excel-vba.html

  • @alexf2863
    @alexf286311 күн бұрын

    Thanks 🙏🏻 I have multiple mails in my outlook account, how I select the account I want to send the mail from ? .from?

  • @ExcelMacroMania
    @ExcelMacroMania10 күн бұрын

    OutMail.SendUsingAccount = OutApp.Session.Accounts("[email protected]")

  • @alexf2863
    @alexf28637 күн бұрын

    @@ExcelMacroMania doesn't work, maybe because is the shared mail of my company

  • @ExcelMacroMania
    @ExcelMacroMania7 күн бұрын

    @@alexf2863 Yes, that could be the reason.

  • @alexf2863
    @alexf28637 күн бұрын

    @@ExcelMacroMania but the res works!! Thanks you 😀

  • @msofficeexpert5549
    @msofficeexpert554912 күн бұрын

    Hi there, Thanks for amazing video please can you share VBA code for organization chart? Many Thanks

  • @ExcelMacroMania
    @ExcelMacroMania12 күн бұрын

    You can find it here: excelmacrobusiness.blogspot.com/2020/06/org-chart-creator.html

  • @mostafaza250
    @mostafaza25013 күн бұрын

    Hello I needed his services when I came to create a Google form with images that showed the images with a title Url I need it to show me the pictures inside the cell. Can I do that?

  • @ExcelMacroMania
    @ExcelMacroMania12 күн бұрын

    Not sure I understand what you want to do. Does that really have something to do with sending meet invites? or is it something completely different? Because this video is just about sending meet invites from Excel.

  • @alexf2863
    @alexf286314 күн бұрын

    How do i put mail in "CC" ? Thanks 🙏🏻

  • @ExcelMacroMania
    @ExcelMacroMania12 күн бұрын

    OutInvite.OptionalAttendees = "[email protected];[email protected]"

  • @mrutyunjaymallik7182
    @mrutyunjaymallik718215 күн бұрын

    Can you please help to solve the error "Runtime error '429' ActiveX component cant create object"

  • @ExcelMacroMania
    @ExcelMacroMania10 күн бұрын

    Make sure you have added the Outlook library to references and you have properly declared/defined the objects. Check the code is correct here: excelmacroclass.blogspot.com/2023/05/send-multiple-emails-from-excel-vba.html

  • @parasgupta1786
    @parasgupta178616 күн бұрын

    Hi, this is something i have been trying to replicate. I tried using the second method from your tutorial. But unable to make it work. can you please help? I keep getting the error "Run-time error. The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available"

  • @ExcelMacroMania
    @ExcelMacroMania10 күн бұрын

    Make sure the code is correct, there was a mistake in the video that I corrected later, maybe you didn't watch the whole video. Also, go to your google account and get the exact address of the smtp server (usually is smtp.gmail.com, but can be different). Try with other port (465 vs 25 vs other?). Make sure you have added the right references to the VBA project. There might be some restrictions in your network, etc. You can find the code here: excelmacroclass.blogspot.com/2024/01/send-google-mail-from-excel-vba-macro.html

  • @muhammadrashid3307
    @muhammadrashid330717 күн бұрын

    Very useful.. Thanks a lot Sir I want to confirm the news about vba support from Microsoft is ending soon????

  • @ExcelMacroMania
    @ExcelMacroMania15 күн бұрын

    In my opinion those are just rumors. I don't think is ever gonna happen in my and probably also you lifetime 🙂There are so many companies and millions of Excel users who rely on VBA automation. And I am talking of desktop Excel of course, we all know VBA/macros are not supported in the online version.

  • @muhammadrashid3307
    @muhammadrashid330715 күн бұрын

    @ExcelMacroMania Thanks

  • @SnehalShivkar-uu2km
    @SnehalShivkar-uu2km18 күн бұрын

    i am calling same macro in my side giving me error ActiveX component cann't create object

  • @ExcelMacroMania
    @ExcelMacroMania15 күн бұрын

    Make sure the code is correct, check it here: excelmacroclass.blogspot.com/2022/05/connect-to-api-excel-vba-macro-part-1.html Also, check if your API requires an API key and you are using the correct URL along a valid API key.

  • @mohanedalwhaibi576
    @mohanedalwhaibi57620 күн бұрын

    hi dear i have a question how can i add the my special email signature to the macro regards

  • @ExcelMacroMania
    @ExcelMacroMania20 күн бұрын

    Here's how you do it for an email. If you want to do add it to the invite just replace OutMail with OutInvite as defined in this video. With OutMail .Display signature = .HTMLBody .To = "[email protected]" .Subject = "email subject" body = "Dear Customer,... bla bla" .HTMLBody = body & signature '.Send 'uncomment to send End With

  • @mohanedalwhaibi576
    @mohanedalwhaibi57620 күн бұрын

    @@ExcelMacroMania .HTMLBody doesn't show in my macro

  • @ExcelMacroMania
    @ExcelMacroMania15 күн бұрын

    @@mohanedalwhaibi576 Make sure you add the Outlook library to references and declare OutMail as MailItem, then when OutMail.HTMLBody would get or set the whole body as HTML.

  • @mohanedalwhaibi576
    @mohanedalwhaibi57615 күн бұрын

    @@ExcelMacroMania oh thanks bro already solved the problem

  • @mohanedalwhaibi576
    @mohanedalwhaibi57620 күн бұрын

    i am using an app called mail came in windows 11 how can i send through it regards

  • @ExcelMacroMania
    @ExcelMacroMania20 күн бұрын

    I believe Mail in Windows 11 is Outlook as part of Microsoft 365, so you should be able to send an in email from Excel using the method described in the other videos (Send Mail from Excel) or this one if you manage to setup a gmail account there.

  • @mohanedalwhaibi576
    @mohanedalwhaibi57620 күн бұрын

    hi thanks for all this but how can i use another app than outlook like mail in windows 11

  • @ExcelMacroMania
    @ExcelMacroMania20 күн бұрын

    You can also send via Gmail, check out this other video: kzread.info/dash/bejne/hmt7waene9y5j5M.htmlsi=cH50psvDsP29qUZz

  • @mohanedalwhaibi576
    @mohanedalwhaibi57620 күн бұрын

    @@ExcelMacroMania Thanks very much i fixed that ❤

  • @TrumPet500
    @TrumPet50022 күн бұрын

    you are amazing!

  • @kimi4asahi
    @kimi4asahi23 күн бұрын

    Hi, I've tried running the code multiple times without the Display cuz I want to try sending it automatically but it's not sending. Sometimes it goes automatically to outbox. Why is that?

  • @ExcelMacroMania
    @ExcelMacroMania21 күн бұрын

    That's the normal behavior of Outlook. Emails go first to the Outbox folder and then to the Sent folder. It usually happens very fast and we do not even realize about it. As you are not automating with Excel, sending many emails takes longer and they may stay longer in the Outbox folder, but eventually should be all sent out. If that does not happen, you could add a short delay within the For loop to let your computer process everything. You can use the function Wait for that.

  • @fender1308
    @fender130825 күн бұрын

    Simple and easy to follow video; helped me a great deal after failing miserably with PowerAutomate. Question - Can I select a specific Row and attach this in the email that goes out?

  • @ExcelMacroMania
    @ExcelMacroMania21 күн бұрын

    Yes, that's actually covered in this other video, check it out: kzread.info/dash/bejne/iqR73Lmvg9Wfmpc.htmlsi=XBwBw9wIQF82hOaB

  • @juliusm367
    @juliusm36726 күн бұрын

    how can i do this to assign a task?

  • @ExcelMacroMania
    @ExcelMacroMania26 күн бұрын

    Dim OutApp As Outlook.Application, NewTask As Outlook.TaskItem Set OutApp = New Outlook.Application Set NewTask = OutApp CreateItem(olTaskItem) NewTask.Display

  • @TheJailProductions
    @TheJailProductions27 күн бұрын

    You're videos are BY FAR the best, most helpful VBA tutorials I have ever seen. You are a great teacher, and thank you so much for everything you've made!

  • @ExcelMacroMania
    @ExcelMacroMania27 күн бұрын

    Thanks a lot for your feedback. It means a lot! 🙂

  • @hiteshrajain9810
    @hiteshrajain9810Ай бұрын

    Hey, thank you very much, when I run the macro it starts loading and after 10-15 secs, it shows “Run-time error” Server execution failed. If anyone can help?

  • @ExcelMacroMania
    @ExcelMacroManiaАй бұрын

    Uhmm.. that's weird. Please check the code here and make sure is correct: excelmacroclass.blogspot.com/2023/05/send-multiple-emails-from-excel-vba.html

  • @jacobazoulay
    @jacobazoulayАй бұрын

    Great video! Im trying to recreate this with cells that are NOT UNDERLINED in literally the same situation as you and im running into an error and the debugging points me to the last statement after "Next r" Runtime error '1004' Method 'Range' of object '_Global' failed Here is my code: Sub GroupCellsSameFormat() Dim r As Integer, lr As Integer, startr As Integer, endr As Integer lr = Cells(Rows.Count, "B").End(xlUp).Row For r = 5 To lr If Range("B" & r).Font.Underline = False Then If startr = 0 Then startr = r + 1 Else endr = r - 1 Range("B" & startr & ":B" & endr).Rows.Group startr = r + 1 End If End If Next r Range("B" & startr & ":B" & lr).Rows.Group End Sub Please let me know what i should do :)

  • @ExcelMacroMania
    @ExcelMacroManiaАй бұрын

    I think the problem is with Range...Font.Underline = False, use instead the following: If Range....Font.Underline = xlUnderlineStyleNone Then ...

  • @AmanKumar-eb5vd
    @AmanKumar-eb5vdАй бұрын

    Is this possible to copy same data in new workbook instead of same sheets. Please help

  • @ExcelMacroMania
    @ExcelMacroManiaАй бұрын

    Yes, you can incorporate the macro in this other video: kzread.info/dash/bejne/a3ubzNF_Z8iwo8o.htmlsi=AU2yu23aeiOFQRJk

  • @AmanKumar-eb5vd
    @AmanKumar-eb5vdАй бұрын

    @@ExcelMacroMania thank you for replying my msg 😀 Let's understand . I have one excel file which has contents 5 sheets with different sheets name , and each sheet have one same column name is state, and total 20 states data each sheet in some sheets have more raw and some sheets have less, and i do filter state data in all sheets and paste in new workbook and save as state name file , and i do same work for every state, this consuming my lots of time . Please help to make a video on this topic.please help🙏

  • @ExcelMacroMania
    @ExcelMacroMania26 күн бұрын

    @@AmanKumar-eb5vd It is difficult to understand exactly what you mean. Maybe you send me the file and I will try to have a look: [email protected]

  • @nadermounir8228
    @nadermounir8228Ай бұрын

    Thank you for this great video

  • @ONESHOT007YT
    @ONESHOT007YTАй бұрын

    You're a gem of a kind❤

  • @simplydoing9596
    @simplydoing9596Ай бұрын

    what is IFQ in URL ??? doing? what does it do ? ITs constants or seperate for us ?

  • @ExcelMacroMania
    @ExcelMacroManiaАй бұрын

    ifq is just a parameter of the google url that indicates the following parameters belong to the various entries in the google form. You do not need to change it or do anything with it, just keep it in the main url that concatenates with each of the entries in the form as explained here: excelmacrofun.blogspot.com/2022/09/excel-data-export-to-google-sheets.html

  • @MohAboAbdo
    @MohAboAbdoАй бұрын

    Thank you so much

  • @SantoshVishwakarma25
    @SantoshVishwakarma25Ай бұрын

    Thank you very much, this is really Very helpful.

  • @albertocollazo9986
    @albertocollazo9986Ай бұрын

    Could please explain how to add an attachment to gmail when the attachment is defined by a variable and not as hard coded path/filename in VBA. Example .Addattachment "c:\data\testmail.xlsx". I'm looking for something along the lines of .Addattachment path & fname & ".pdf" where both the path and fname are variables defined as strings in the macro. Thank you in advance for your help

  • @ExcelMacroMania
    @ExcelMacroManiaАй бұрын

    CDOmail.Attachment "c:\data\testmail.xlsx"

  • @albertocollazo9986
    @albertocollazo9986Ай бұрын

    @@ExcelMacroMania Thank you for your kind and timely answer

  • @blakeM193
    @blakeM193Ай бұрын

    This playlist is amazing, thank you! Any chance you could do a video expanding more on how to do the "2nd level authentication" with a token and encoding?

  • @ExcelMacroMania
    @ExcelMacroManiaАй бұрын

    Thanks! And yes, I will definitely do it but I don't be able to work on it until after the summer.

  • @wesam28
    @wesam28Ай бұрын

    Thank you so much 😭

  • @createistudyo1055
    @createistudyo1055Ай бұрын

    Thank you :)

  • @Powner187
    @Powner187Ай бұрын

    Looks cool. Definitely will watch again to understand the code.

  • @suvendubiswas3978
    @suvendubiswas3978Ай бұрын

    What if I want to copy it to a new excel file? Kindly help

  • @ExcelMacroMania
    @ExcelMacroManiaАй бұрын

    Use Workbooks.Add to create a new workbook and set it to a variable that you can use later. You probably need at least 2 variables, wb1 and wb2. Then refer each accordingly. Check this video for example: kzread.info/dash/bejne/a3ubzNF_Z8iwo8o.htmlsi=hT9QfVcFdiePXNd3 Also, you can probably check some videos of the workbook object to learn that well: kzread.info/dash/bejne/pIKlw65mesqoqLg.htmlsi=Pn0cWJ6FpGruXbjy kzread.info/dash/bejne/oYiuu5ZtpdLbYbQ.htmlsi=bAk0D9ZPcoZyAQm1

  • @will_351
    @will_351Ай бұрын

    hi, thanks for sharing, but if i want to cut duplicates in another worksheet?

  • @ExcelMacroMania
    @ExcelMacroManiaАй бұрын

    Reference the target worksheet with Sheets("targetSheet").... for example. See more about the worksheet object here: kzread.info/dash/bejne/qJyE0LSKmLKqcto.htmlsi=oVc2D11DP3uTo6A2