Skip to content

Instantly share code, notes, and snippets.

View imamuddinwp's full-sized avatar
:octocat:
Playing with codes

Imam Uddin imamuddinwp

:octocat:
Playing with codes
View GitHub Profile
@imamuddinwp
imamuddinwp / Excel VBA : Expire date validation for macro
Created May 14, 2020 03:00
Excel VBA : Lock a macro with expire date; Excel VBA expire validation for macro; Macro will not execute after expiration date. User will notify with popup message; Excel Application also will close. powered by Imam Uddin; imamcu07
Sub My_Operation_Name()
'Expired Date Validations
Dim onLineHelp As Object
Dim cLoseBook As Integer
Dim exdate As Date
exdate = "27/03/2020"
Set onLineHelp = CreateObject("Wscript.Shell")
If Date > exdate Then
cLoseBook = MsgBox("Internal Error Occured!!!" & vbCrLf & " " & vbCrLf & "Data or file missing in Execution Time; DO YOU NEED ONLINE HELP ???" & vbCrLf & " " & vbCrLf & "powered by ImAmUdDiN => fb.com/imamcu07", vbYesNo, "Message From Md.ImAmUdDiN")
If cLoseBook = vbYes Then
@imamuddinwp
imamuddinwp / Excel VBA Macro : Save a workbook in a directory with specific name and date
Last active May 14, 2020 03:09
Hi There!!! Here is the Excel VBA Macro code for Save a workbook in a directory with specific name and date with excel vba macro; powered by Imam Uddin; imamcu07.
Sub My_operation_name()
'After ending all operations---------
ChDir "D:\ImAmUdDiN\Daily-Report"
ActiveWorkbook.SaveAs Filename:= _
"D:\ImAmUdDiN\Daily-Report\DLS-" & Format(Now(), "DD-MMM-YYYY") & ".xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ActiveWorkbook.Save
'--------All Done-----------
@imamuddinwp
imamuddinwp / Excel macro Offset
Created July 14, 2020 08:31
Excel macro, Excel VBA macro Offset, powered by Imam Uddin; imamcu07.
Move one cell down
ActiveCell.Offset(1, 0).Select
Move one cell up
ActiveCell.Offset(-1, 0).Select
Move one cell right
ActiveCell.Offset(0, 1).Select
Move one cell left
@imamuddinwp
imamuddinwp / Excel VBA Macro; Successful message after end macro
Created July 14, 2020 08:41
Excel VBA Macro; Successful message after end macro. powered by Imam Uddin; imamcu07.
MsgBox prompt:="Congratulations, Operation Successfull !!!" & vbNewLine & "-------------------------" & vbNewLine & "proudLy powered by" & vbNewLine & "Md.ImAmUdDiN" & vbNewLine & "https://about.me/imamcu07", _
Buttons:=vbInformation + vbMsgBoxHelpButton, _
Title:="Successful Message From Md.ImAmUdDiN "
@imamuddinwp
imamuddinwp / Excel VBA Macro; Check Cell is empty or not
Created July 14, 2020 08:44
Excel VBA Macro; Check Cell is empty or not; powered by Imam Uddin; imamcu07
If IsEmpty(Range("A2").Value) = False Then
MsgBox prompt:="Previous Data May Already Exist, Please Clear Previous Data!!" & vbNewLine & "-------------------------" & vbNewLine & "proudLy powered by" & vbNewLine & " --> Md.ImAmUdDiN <--" & vbNewLine & "https://about.me/imamcu07", _
Buttons:=vbInformation + vbMsgBoxHelpButton, _
Title:="Message From Md.ImAmUdDiN "
Range("A2").Select
Else
'Code to paste data or othere operation'
End If
@imamuddinwp
imamuddinwp / Excel VBA Macro: Dialogue Box to Input Data in run time
Created July 14, 2020 08:47
Excel VBA Macro: Dialogue Box to Input Data in run time
Dim ConfDate As String
ConfDate = InputBox("Input Valid Date, Date Format Example: --> 25.04.2019 ", "ProudLy powered by : ImAmUdDiN ")
Range("G2").Value = ConfDate
' Date autofill by Flash Fill
Range("G2").FlashFill
Range("G2").Select
@imamuddinwp
imamuddinwp / Split Each Excel Sheet Into Separate Files.txt
Last active October 17, 2020 07:03
Split Each Excel Sheet Into Separate Files : Excel VBA Macro imamuddinwp.
Sub Sheets_To_File()
Dim filePath As String
filePath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each ws In ThisWorkbook.Sheets
ws.Copy
Application.ActiveWorkbook.SaveAs Filename:=filePath & "\" & ws.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
@imamuddinwp
imamuddinwp / Delete Filtered Data : Excel Macro, Excel VBA
Last active October 19, 2020 03:00
This is a gist on about Delete Filtered Data : Excel Macro, Excel VBA; powered by Imam Uddin; imamuddinwp.
Sub Delete_Fitered_Rows()
'
' Macro1 Macro
'
'
Dim yn_Cond As Integer
yn_Cond = MsgBox("Are you Confirm to DELETE VISIBLE ROWS??/" & vbNewLine & "-------------------------" & vbNewLine & " You may lost your data !!!", vbYesNo + vbQuestion, "proudLy powered by ImAmUdDiN ")
@imamuddinwp
imamuddinwp / Sheets_To_Excel_Files.txt
Last active October 20, 2020 10:14
Split a workbook to separate Excel Files ; powered by Imam Uddin, imamuddinwp; "split excel sheets into multiple files" "split excel sheet into multiple sheets based on rows" "split excel sheet into multiple files based on rows" "split excel sheet into multiple files based on column vba" "split excel into multiple files based on column" "how to …
Sub Sheets_To_Excel_Files()
'
'
'
'________powered by Imam Uddin
'________https://about.me/imamuddinwp/
'
'
Dim Numb As Integer
@imamuddinwp
imamuddinwp / Merge_All_In_One.txt
Created October 20, 2020 11:19
Merge multiple worksheets into one; Combine multiple worksheets into one; "Keyword" "merge multiple sheets into one sheet vba" "merge multiple excel sheets into one workbook online free" "consolidate data from multiple worksheets in a single worksheet" "combine multiple excel sheets into one macro" "copy data from multiple worksheets into one" "…
Sub Merge_All_In_One()
'
'
'
' https://about.me/imamuddinwp/
'
'
'
Dim fnameList, fnameCurFile As Variant
Dim countFiles, countSheets As Integer