Open Last Modified Excel File From A Folder Through Vba

Dear All,   We can use below vba code to open last modified excel file from a folder.   Sub Last_Modified_File() x = InputBox(“put Folder Path”) folder_name = x & “\” flname = Dir(folder_name & “*.xlsx”) Do While Len(flname) > 0 dttime = FileDateTime(folder_name & flname) If dttime > qq Then qq = dttime End If flname = Dir() Loop folder_name = x & “\” flname = Dir(folder_name & “*.xlsx”) Do While Len(flname) > 0 dttime = FileDateTime(folder_name & flname) […]

Read more

MKDIR Function in Excel Vba

MKDIR   In excel vba we use MKDIR vba function to create folder. MKDIR Function का उपयोग हम excel vba में folder बनाने के लिए करते है. I have to make a folder in D Drive which name will be computer. For this we have type code हमें D drive में एक फोल्डर बनाना है जिसका नाम COMPUTER होगा. इसके लिए हमें यह कोड लिखना होगा. Sub MakeFolder() MkDir “D:\COMPUTER” End Sub This Code will make folder in D Drive. यह […]

Read more

Match_Function

MATCH Function in Excel एक्सेल में मैच फंक्शन का प्रयोग   With the help of match function we find out position of a lookup value in a row or column. It does not return the value. MATCH supports approximate and exact matching, and wildcards (* ?) for partial matches. We often use match with Index and Vlookup for getting data. It can be used with text and numbers. This function looks for an item in a list and shows its position.   […]

Read more

Copy All Sheets Data In Master_Sheet

Copy All Sheet Data In Master_Sheet   I have excel file which has 3 sheet,From below vba macro code we can copy all sheets data in master Sheet.   मेरे पास तीन sheet वाली excel फाइल है.निचे लिखे VBA Macro Code से हम सारे  sheets का डाटा Master Sheet में copy कर सकते हैं. Sub Add_All_sheet_Data() sheetcount = Sheets.Count Worksheets.Add after:=Sheets(Sheets.Count) ‘Worksheets.Add after:=Sheets(Sheetcount) ActiveSheet.Name = “Master” For i = 1 To sheetcount Sheets(i).Activate Range(“a1”).CurrentRegion.Select Selection.Copy Sheets(“Master”).Activate Range(“a1048576”).End(xlUp).Offset(1, 0).Select ActiveSheet.Paste If […]

Read more

How To Use Edate Function In Excel

EDATE   With the use of Excel EDATE function, we add or subtract month, with a date. We use EDATE function to calculate Maturity Dates, Expiration Dates, Due Dates, Project Start Date, Project End Date. If we use month value as positive, then it will go future date, if we use month value as negative then it will go past date, if we use month value 0 then it will show same date. Here only month & year will be […]

Read more

ActiveX Controls In Excel with VBA Code

Dear All, From this video you can learn use of Check Box Option Button Label Command Button Group Box Download Excel From Here Below Code has been used. Private Sub CommandButton1_Click() If TextBox1.Value = “” Or Len(TextBox1.Value) < 5 Then TextBox1.Value = “” Exit Sub End If If Range(“j5000”).End(xlUp).Value = “Roll” Then Range(“j5000”).End(xlUp).Offset(1, 0).Value = 1 Else Range(“j5000”).End(xlUp).Offset(1, 0).Value = Range(“j5000”).End(xlUp).Value + 1 End If TX = TextBox1.Value Range(“j5000”).End(xlUp).Offset(0, 1).Value = UCase(TX) If OptionButton1.Value = True Then op1 = OptionButton1.Caption […]

Read more