This is a short step-by-step tutorial for beginners showing how to add VBA code (Visual Basic for Applications code) to your Excel workbook and run this macro to solve your spreadsheet tasks. Continue reading
by Alexander Frolov, updated on
This is a short step-by-step tutorial for beginners showing how to add VBA code (Visual Basic for Applications code) to your Excel workbook and run this macro to solve your spreadsheet tasks. Continue reading
Comments page 6. Total comments: 256
Excellent guideline. Thanks.
This is excellent! I work at an I-Bank this is gold! Thank you Sir.
Hi. I'm using a macro to combine multiple sheets in one excel workbook. Macro works but I keep getting a screen that asks me if I want to save or dont save I want to add this step into the macro, can someone please help?
Thank you in advance.
Sub GetSheets()
Path = "\\>>>>>>>>>Extract for CD 20171027\"
Filename = Dir(Path & "*.xls")
Do While Filename ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=ThisWorkbook.Sheets(1)
Next Sheet
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
Thank you so much! I've never added a macro and the steps were super easy to follow. Easy fix.
how to use a module in a userform more than textboxes in same module
please given the code and how to create a time symbol provide a number format example (1230 =12:30) in this code give to me
thanks you
bvfhj
Hi,
Please help me. I want to color cell background by comparing with cell value and one more cell value. Example: Col A (1:10) has values 0 & 1. Col B:E (B1:E10) has values of 1-100. Color B1:E10 if the value of cell >50 & A1 equal to 0. Total four colors and four conditions.
1) A1:A10 = 0 then B1:E10 =50
3) A1:A10 = 1 then B1:E10 =50
I am able to create only for if B1:E10 >/<50.
Thanks,
Ravi
I went through the steps above to add VBA code to my spreadsheet, however, when opening the macro, there is nothing listed for selection. Why is that? (In other words, I can see the information through ALT + F11, but when selecting ALT + F8, the macro is not there).
Hi.
I wanted to have the Grouping function on a protected excel. I got a solution on the web, for a vba code to be used.
link - https://www.extendoffice.com/documents/excel/1723-excel-group-ungroup-in-protected-sheet.html
But the issue is that I want it all the time on the excel. How can I save it so that each time I open the excel, the function is working for grouping and ungrouping in the excel template.
Thanks
I want to save a running total from a cell in Excel and wondered can this be done? I have a formula to put the total in a cell on a certain date but when the date has passed it clears the cell again and I want the running total on that date to be captured. My formaula in excel to capture data on a certian date is:- =IF(D2=(DATE(2017,6,11)),D3,0)
Thanks for any info, Cheers Trev
Hi
Can this code be applied to all worksheets? if yes help me make it permanent in excel. I tried to save as a add-in but its not working all workbooks.
Hi
How to run macro in MS Task scheduler, please help me.
Hi,
I am trying to create a button in excel that when clicked it, will add 1 point to a score on different sheet (sheet 2). I can't seem to find out if this is possible, and if it is, how to do it.
Ideally I want to have multiple buttons so I can create scoring charts (team 1's score in B1, team 2's score in B2, etc) but you won't be able to see it until you go on to sheet 2.
Any help would be gratefully received!
A notification bar appears which reads:
Be careful! Parts of your document may include personal information that cannot be removed by the Document Inspector
Is there a way to have this constant and not having to run the Macro for it to be applied?
Hi sir
I want VBA code for to display the excel data in text box. For example 3 text boxes in VBA form in excel a1,b1,c1 have data. If a1 and b1 data typed in text box 1 and 2 c1 data will display in textbox3.
Hi Alexander,
Please help me out when i use VBA coding for Consolidated Data show this error.
---------------------------
Microsoft Visual Basic for Applications
---------------------------
Compile error:
Sub or Function not defined
---------------------------
OK Help
---------------------------
I've followed all the steps, but I'm having a problem with the code doing what I need. Instead of adding the dollar amounts in the cells that have a specific colored background, I'm getting how many cells have that colored background. Example: 5 green cells with $20 in each of them, the code gives me $5 when it should be $100.
I need to Increment 50 by 0.64 everyday at 8:00 AM and I would like to automate it. I've already have a Now function that updates every second, I also need a way to start it when Excel is opened.
Where/how do I see the results, after I run the code above?
it is way too complicated i just want a print screen macro
Worked great! I didn't bother with any of the added code. Thanks!
Can anyone tell me that how to run any of macro program in excel?
I entered a VBA for excel 2013. I wanted to make a drop down list w/ multi items to select. It works perfectly for me, but when I send it to my associate it does not work...only single selection is possible. Is that because they do not have a, "developer" ribbon? I cannot have everyone do that....so is there a workaround? Thanks for your valuable time!
thank you sir for treating my worries
how do i run a vba code using a macro such that each time i click on the macro, it runs my vba code
Thanks for the Aritical.
Delete entire row from A2 downwards with the word "0o,rb,t"in column A
Hello,
I am trying to import data from certain columns from an excel sheet "MyData.xlsx" into "PriceInc.xlsx"
There is a button on the "PriceInc.xlsx" file that, when clicked should bring in the required data.
Hi , I just started with VBA using it for the first time , I wrote code under module but When I am clicking on "Run".
It is not giving me any result.
Suppose I use a command :
Sub hello()
MsgBox ("Helloworld")
End Sub
When I am running it , it is not getting published in Excel workbook
Hi, khush
Sub hello()
MsgBox "Helloworld"
End Sub
Plz Send All details With Screen Shot.that how to create VBA in Excell Sheet
Thanks!
I am opening a "shared" spreadsheet, that sits on our Corporate NAS. I have copied the file off the NAS to my home computer, in order to add some VBA code - for displaying the sheet and refreshing at set intervals. However, when I open the Developer tab and attempt to right click on the sheet, all my options are greyed out? Is this because the sheet has been placed in "shared mode" from within Excel (not sure how to disable that and add the code, then re-enable shared mode). I will need to put it back on the NAS when the code has been added. NB: The VBA code was produced by a freelancer at guru.com to refresh each of the four tabs on the sheet, every 15 seconds.. Thanks! (I have a screen capture I could send you).
Thank you, Alexander.
You have solved my problem.
I want to create a data base using excel i want to create it where if i search the item the prices and purchased store will appear
Hi i have used the line break formula, and it is working great.
Further please help in make macro to break line. As in if there are double spacing in between two words, then that should come in the next line of the cell.
Thanks
Hi,
I want to put a macro to getting the first line bold on the selected column
Please help!
I created a little ActiveX control (spin up/down)via VBA for my PPT chart. But I can't find anywhere in the videos how to save it in order to use it. Can someone please tell me how or direct me where to go? Thanks.
Hi ,
Can you please share a copy of a worked file on which macro is created and run to my mail Id as in shared. just to take it as a example and work with
Regards,
Chandini.E
I would like to create a macro where you go through the steps to insert a picture into a comment, but i would like to have the macro stop at the insert picture screen so it is simple for whoever is using the document can go directly to the insert a picture popup and finish the request.
Sir,
now, i want to make Dashboard to Summarise the Sales data, Return, & Stock , Date wise transaction & Unique Column is SKU Code, kindly help me how to process it on every 7 Days, if you have any templet as our Requirement , then pls provide.
Thanks
ashish
hi
How do i change excel sheet1, sheet2,.... at the bottom of the screen, to appear as a navigation tab on top of the screen?
Hello Alexander.
Could you please let me know why the below code is not running when I click on Run button, there is no response nor error message populated.
Sub LoopThroughDirectory()
Dim MyFile As String
Dim erow
MyFile = Dir("C:\Users\r628956\Desktop\Salesforce\Rating\Automation\Master")
Do While Len(MyFile) > 0
If MyFile = "zmaster.xlsm" Then
Exit Sub
End If
Workbooks.Open (MyFile)
Range("A2:D2").Copy
ActiveWorkbook.Close
erow = Sheet1.Cells(Rows.Count, 1).End(x1Up).Offset(1, 0).Row
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range
MyFile = Dir
Loop
End Sub
Thank you - Rajkumar
I m give information for vba programing
Ripper, thanks for this
Hello All .Very useful article. Would you be able to to help me for the following : i have a text in Excel worksheet that i want to copy and paste into Excel VB Standard Module . Currently I can do it using "Cntl C" to copy and then Cntl V " to paste into Excel VB Module . Can you please suggest some other method of how it can be done without pushing the above buttons.
i m new to this excel and vba but i know vb how to work on this
sry
fhfghgvnvfdg
Hi im not able to run 2 different modules at the same time using the spellnumber formula i want to be using it for 2 different currencies
kindly advise