Posts by jhas56788
-
-
plz see the below link
https://www.extendoffice.com/d…box-to-display-range.html
It has done something like my needs
-
No problem So plz help me with the alternative solution for the same Roy Sir
-
[xpost]
[/xpost]
Hi Experts,
I am looking for a macro that will do the the things mentioned below
Macro will be placed in a macro.xlsm
macro.xlsm & sample.xlsb both are located in different path so the path should be hardcoded in the macro, so i can change it as per my needs
I am looking for a msgbox which contains the data as i mentioned in the sample file (The data will change but when i run the macro then i need a msg box of the same along with the data in the msgbox & that msgbox will only be closed by the paasword, cancel option should not work,without putting paasword in it that msgbox will not be closed)
I have Highlighted the data for which i need a msgbox(In actual file there will not be any highlighted data, I have highlighted it only for understanding purpose)
Thnx For the Helphttps://www.excelforum.com/exc…e-msgbox.html#post5383814
-
Code
Display MorePublic Declare PtrSafe Function ShellExecute _ Lib "shell32.dll" _ Alias "ShellExecuteA" ( _ ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) _ As Long Sub FFF() Dim strFileName As String Dim strFileExists As String strFileName = "C:\Users\WolfieeeStyle\Desktop\Close Excel.lnk" strFileExists = Dir(strFileName) If strFileExists = "" Then Set FSO = CreateObject("scripting.filesystemobject") FSO.MoveFile Source:="C:\Users\WolfieeeStyle\Desktop\Close Excel.lnk", Destination:="C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\" ShellExecute 0, "OPEN", "C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\Close Excel.lnk", "", "", 1 Else End If End Sub
I am looking for a macro that will
First Check Close Excel.lnk is located or not & if it is located then move that Close Excel.lnk to C:\Users\WolfieeeStyle\Desktop\WolfieeeStyle\9.15\ & then run that Close Excel.lnk
& If the Close Excel.lnk file is not located then do nothing
Thnx -
Sorry Bro I was busy at that time
Sorry for the same
In Future it willl not be repeated Roy Sir
-
I got ur point JoliVanes
I won't have time to Share the code at this before tomorrow.
Have A Great Day
-
One of my Frnd helped me for the same
-
Problem Solved
-
No issues take ur time Roy Sir
-
If u r unable to solve this problem Roy Sir then No issue atleast let me know
I will break this process into two pieces
& i will start a new thread to solve this problem in a different way & plz do not close that post bcoz if its not solvable then i have to think & solve it in a different way
-
the output should be
-
Code
Display MoreSub Step14() Dim w1 As Workbook, w2 As Workbook, w3 As Workbook Set w1 = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\1.xls") Set w2 = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\2.csv") Set w3 = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\3.xlsx") Dim Ws1 As Worksheet, Ws2 As Worksheet, Ws3 As Worksheet Set Ws1 = w1.Worksheets.Item(1) Set Ws2 = w2.Worksheets.Item(1) Set Ws3 = w3.Worksheets.Item(1) Dim Lc3 As Long, Lenf1 As Long, Lr1 As Long Let Lr1 = Ws1.Range("A" & Ws1.Rows.Count & "").End(xlUp).Row Let Lc3 = Ws3.Cells.Item(1, Ws3.Columns.Count).End(xlToLeft).Column Dim Lc3Ltr As String Let Lc3Ltr = "K" Let Lenf1 = Lr1 - 1 Dim rngOut As Range: Set rngOut = Ws2.Range("A1:" & Lc3Ltr & Lenf1 & "") Ws2.Cells.NumberFormat = "General" Let rngOut.Value = "='[3.xlsx]" & Ws3.Name & "'!A$1" Let rngOut.Value = rngOut.Value Let rngOut.Value = Evaluate("If({1},SUBSTITUTE(" & rngOut.Address & ", ""0"", """"))") Dim rngIn As Range Set rngIn = Ws3.Range("A1:" & Lc3Ltr & "1") rngIn.Copy rngOut.PasteSpecial Paste:=xlPasteValues w1.Close w2.Save Let Application.DisplayAlerts = False w2.Close Let Application.DisplayAlerts = True w3.Close End Sub
This code gives output but in column A plz see the sample pic all data is pasted to column A only
-
-
I GOT THE CODE FROM GOOGLING AND SEEING MANY VARIATIONS OF THE VBA CODE AND I MADE THE SAME
plz correct the code so that it doesnt get any errors
-
Plz see Roy Sir
-
vba will be placed in a seperate file macro.xlsm
i have 1.xls it has data
dont count the first row of 1.xls
i need a macro that will count the total no. of rows that has data and paste it to I1
plz see the sample file
i need the vba to do the same -
Code
Display MoreSub Step14() Dim w1 As Workbook, w2 As Workbook, w3 As Workbook Set w1 = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\1.xls") Set w2 = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\2.csv") Set w3 = Workbooks.Open("C:\Users\WolfieeeStyle\Desktop\3.xlsx") Dim Ws1 As Worksheet, Ws2 As Worksheet, Ws3 As Worksheet Set Ws1 = w1.Worksheets.Item(1) Set Ws2 = w2.Worksheets.Item(1) Set Ws3 = w3.Worksheets.Item(1) Dim Lc3 As Long, Lenf1 As Long, Lr1 As Long Let Lr1 = Ws1.Range("A" & Ws1.Rows.Count & "").End(xlUp).Row Let Lc3 = Ws3.Cells.Item(1, Ws3.Columns.Count).End(xlToLeft).Column Dim Lc3Ltr As String Let Lc3Ltr = CL(Lc3) Let Lenf1 = Lr1 - 1 Dim rngOut As Range: Set rngOut = Ws2.Range("A1:" & Lc3Ltr & Lenf1 & "") Ws2.Cells.NumberFormat = "General" Let rngOut.Value = "='[3.xlsx]" & Ws3.Name & "'!A$1" Let rngOut.Value = rngOut.Value Let rngOut.Value = Evaluate("If({1},SUBSTITUTE(" & rngOut.Address & ", ""0"", """"))") Dim rngIn As Range Set rngIn = Ws3.Range("A1:" & Lc3Ltr & "1") rngIn.Copy rngOut.PasteSpecial Paste:=xlPasteValues w1.Close w2.Save Let Application.DisplayAlerts = False w2.Close Let Application.DisplayAlerts = True w3.Close End Sub
Sorry Roy Sir i met with an error Problem is not solved
issue is with this line
It paste the data column A only Plz help me in solving the same Sir
-
Problem Solved
-
Roy Sir u need more information then plz let me know