Location xls to single xls:Option Explicit Sub CombineFiles() Dim Path As String Dim FileName As String Dim Wkb As Workbook Dim WS As Worksheet Application.EnableEvents = False Application.ScreenUpdating = False Path = "D:\Documents and Settings\305019854\Desktop\test" 'Change as needed FileName = DRead more
Location xls to single xls:
Option Explicit
Sub CombineFiles()
Dim Path As String Dim FileName As String Dim Wkb As Workbook Dim WS As Worksheet
Application.EnableEvents = False Application.ScreenUpdating = False Path = “D:\Documents and Settings\305019854\Desktop\test” ‘Change as needed FileName = Dir(Path & “\*.xls”, vbNormal) Do Until FileName = “” Set Wkb = Workbooks.Open(FileName:=Path & “” & FileName) For Each WS In Wkb.Worksheets WS.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count) Next WS Wkb.Close False FileName = Dir() Loop Application.EnableEvents = True Application.ScreenUpdating = True
End Sub
this is for combine
Sub Combine1() Dim J As Integer
On Error Resume Next Sheets(1).Select Worksheets.Add ‘ add a sheet in first place Sheets(1).Name = “Combined”
‘ work through sheets For J = 2 To Sheets.Count ‘ from sheet 2 to last sheet Sheets(J).Activate ‘ make the sheet active Range(“A1”).Select Selection.CurrentRegion.Select ‘ select all cells in this sheets
‘ select all lines except title
‘ copy cells selected in the new sheet on last line Selection.Copy Destination:=Sheets(1).Range(“A65536”).End(xlUp)(2) Next End Sub
i got mine to work using yours as a basis. What i did, first i made a batchfile that did the execution of the plink command,and i made a remote-commands-script file to test.the batchfile (test.bat) content:c:\putty\plink -l USER -pw PASS -m c:\putty\nixscrip -ssh shell.isp.netexit"nixscrip" just droRead more
i got mine to work using yours as a basis. What i did, first i made a batchfile that did the execution of the plink command, and i made a remote-commands-script file to test. the batchfile (test.bat) content: c:\putty\plink -l USER -pw PASS -m c:\putty\nixscrip -ssh shell.isp.net exit
“nixscrip” just drops a breadcrumb (tracer) to let me know it was there. nixscrip content: echo testing>fil.fil exit
then instead of using the .exec, i used “.run”: set wsh=createobject(“wscript.shell”) wsh.run(“\putty\test.bat”),1
still working on getting that damn dosbox to close though. so far it just sits there when done. why in hell MS did not build window autoclose when “exit” from batchfile? thanks for posting your code, it motivated me to start playing with putty and plink, and i learned a lot from your code. Hth. update: cmd /c fixed the dosbox issue: wsh.run (“cmd /c \putty\test.bat”)
Hi Razor,One more help on this. Im taking the resultset of the query in txt file. im using the below code.Const fileName = "ID_Cards_New_Individual.txt" ConnectString = "Driver={SQL Server};Server=FATEST;Database=fa4_glhp_test"Const FileQuery = "Exec ID_Cards_New_Individual '04/15/2013'"'Const SummaRead more
Hi Razor,
One more help on this. Im taking the resultset of the query in txt file. im using the below code.
Set fso = CreateObject(“Scripting.FileSystemObject”) Set com = CreateObject(“ADODB.Command”) com.ActiveConnection = ConnectString com.CommandTimeout = 90 com.CommandText = FileQuery Set rs = com.Execute rs.MoveFirst : Set outFile = fso.OpenTextFile(fileName, 2, True) ‘outFile.WriteLine(Date) Do Until rs.EoF For Each f In rs.Fields line = Line & “,” & f Next ‘f outFile.WriteLine Mid(line, 2) rs.MoveNext : line = “” Loop outFile.Close
The result is coming in the below format. 0000003956,200344086,MARY,ENGLAND,
I want the result to come like below with double quotes “0000003956”,”200344086″,”MARY”,”ENGLAND”,
You could restart the program again by using this:START "BATCHFILENAME.BAT"EXITTry replacing the "goto :test" line with the above 2 lines. Leave the quotes around BATCHFILENAME, or the program won't work right.Mouse could not be found. Click OK to continue.What to do now?
You could restart the program again by using this:
START “BATCHFILENAME.BAT” EXIT
Try replacing the “goto :test” line with the above 2 lines. Leave the quotes around BATCHFILENAME, or the program won’t work right.
Mouse could not be found. Click OK to continue. What to do now?
@echo off & setLocal EnableDELAYedeXpansion for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do ( if exist %%d: ( for /f "tokens=* delims= " %%a in ('dir/b/s %%d:\basecontent.7z 2^>nul') do ( 7za.exe x "%%a" ) ) ) =====================================Helping others achieve escapeRead more
@echo off & setLocal EnableDELAYedeXpansion
for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist %%d: (
for /f "tokens=* delims= " %%a in ('dir/b/s %%d:\basecontent.7z 2^>nul') do (
7za.exe x "%%a"
)
)
)
Hi,Try this formula: =HOUR(A3-A2)+MINUTE(A3-A2)/60Format the cell with the formula as a number with two decimal places.The formula returns the complete hours plus the minutes expressed as a fraction of an hour.Regards
Hi,
Try this formula:
=HOUR(A3-A2)+MINUTE(A3-A2)/60
Format the cell with the formula as a number with two decimal places.
The formula returns the complete hours plus the minutes expressed as a fraction of an hour.
Odds are you set it to not provide ip addresses since it was configured just as a AP. With it disconnected from the network and one a single pc wired to its lan port, set it back to factory defaults, reboot your pc so it gets a ip address and then enter the router config to reconfigure as an AP>ARead more
Odds are you set it to not provide ip addresses since it was configured just as a AP.
With it disconnected from the network and one a single pc wired to its lan port, set it back to factory defaults, reboot your pc so it gets a ip address and then enter the router config to reconfigure as an AP>
Is There Any Way To Remove Pop Ups From My TV?
how to block pop up ads on samsung smart tvhttps://www.google.com.au/webhp?hl=...
https://www.google.com.au/webhp?hl=…
Vbscript To Merge Excel Files
Location xls to single xls:Option Explicit Sub CombineFiles() Dim Path As String Dim FileName As String Dim Wkb As Workbook Dim WS As Worksheet Application.EnableEvents = False Application.ScreenUpdating = False Path = "D:\Documents and Settings\305019854\Desktop\test" 'Change as needed FileName = DRead more
Option Explicit
Sub CombineFiles()
Dim Path As String
Dim FileName As String
Dim Wkb As Workbook
Dim WS As Worksheet
Application.EnableEvents = False
Application.ScreenUpdating = False
Path = “D:\Documents and Settings\305019854\Desktop\test” ‘Change as needed
FileName = Dir(Path & “\*.xls”, vbNormal)
Do Until FileName = “”
Set Wkb = Workbooks.Open(FileName:=Path & “” & FileName)
For Each WS In Wkb.Worksheets
WS.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
Next WS
Wkb.Close False
FileName = Dir()
Loop
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
this is for combine
Sub Combine1()
Dim J As Integer
On Error Resume Next
Sheets(1).Select
Worksheets.Add ‘ add a sheet in first place
Sheets(1).Name = “Combined”
‘ copy headings
Sheets(2).Activate
Range(“A1”).EntireRow.Select
Selection.Copy Destination:=Sheets(1).Range(“A1”)
‘ work through sheets
For J = 2 To Sheets.Count ‘ from sheet 2 to last sheet
Sheets(J).Activate ‘ make the sheet active
Range(“A1”).Select
Selection.CurrentRegion.Select ‘ select all cells in this sheets
‘ select all lines except title
‘ copy cells selected in the new sheet on last line
Selection.Copy Destination:=Sheets(1).Range(“A65536”).End(xlUp)(2)
Next
End Sub
Enjoy 🙂
VBS (Within HTA) Plink
i got mine to work using yours as a basis. What i did, first i made a batchfile that did the execution of the plink command,and i made a remote-commands-script file to test.the batchfile (test.bat) content:c:\putty\plink -l USER -pw PASS -m c:\putty\nixscrip -ssh shell.isp.netexit"nixscrip" just droRead more
and i made a remote-commands-script file to test.
the batchfile (test.bat) content:
c:\putty\plink -l USER -pw PASS -m c:\putty\nixscrip -ssh shell.isp.net
exit
“nixscrip” just drops a breadcrumb (tracer) to let me know it was there. nixscrip content:
echo testing>fil.fil
exit
then instead of using the .exec, i used “.run”:
set wsh=createobject(“wscript.shell”)
wsh.run(“\putty\test.bat”),1
still working on getting that damn dosbox to close though. so far it just sits there when done. why in hell MS did not build window autoclose when “exit” from batchfile?
thanks for posting your code, it motivated me to start playing with putty and plink, and i learned a lot from your code.
Hth.
update: cmd /c fixed the dosbox issue:
wsh.run (“cmd /c \putty\test.bat”)
Loop Through Arguments Passed To Batch Script
:loop @echo %1 shift if not "%~1"=="" goto loopHow To Ask Questions The Smart Way
How To Ask Questions The Smart Way
Solved Executing SQL Queries In VBS Script
Hi Razor,One more help on this. Im taking the resultset of the query in txt file. im using the below code.Const fileName = "ID_Cards_New_Individual.txt" ConnectString = "Driver={SQL Server};Server=FATEST;Database=fa4_glhp_test"Const FileQuery = "Exec ID_Cards_New_Individual '04/15/2013'"'Const SummaRead more
One more help on this. Im taking the resultset of the query in txt file. im using the below code.
Const fileName = “ID_Cards_New_Individual.txt”
ConnectString = “Driver={SQL Server};Server=FATEST;Database=fa4_glhp_test”
Const FileQuery = “Exec ID_Cards_New_Individual ’04/15/2013′”
‘Const SummaryQuery = “select count(*) from fi4_xc_prod.dbo.XC_BUF where TBL_ORDER_ID=’C'”
Set fso = CreateObject(“Scripting.FileSystemObject”)
Set com = CreateObject(“ADODB.Command”)
com.ActiveConnection = ConnectString
com.CommandTimeout = 90
com.CommandText = FileQuery
Set rs = com.Execute
rs.MoveFirst : Set outFile = fso.OpenTextFile(fileName, 2, True)
‘outFile.WriteLine(Date)
Do Until rs.EoF
For Each f In rs.Fields
line = Line & “,” & f
Next ‘f
outFile.WriteLine Mid(line, 2)
rs.MoveNext : line = “”
Loop
outFile.Close
The result is coming in the below format.
0000003956,200344086,MARY,ENGLAND,
I want the result to come like below with double quotes
“0000003956”,”200344086″,”MARY”,”ENGLAND”,
Please help…
DOS Batch If File Exists Rename Sequentially
You could restart the program again by using this:START "BATCHFILENAME.BAT"EXITTry replacing the "goto :test" line with the above 2 lines. Leave the quotes around BATCHFILENAME, or the program won't work right.Mouse could not be found. Click OK to continue.What to do now?
START “BATCHFILENAME.BAT”
EXIT
Try replacing the “goto :test” line with the above 2 lines. Leave the quotes around BATCHFILENAME, or the program won’t work right.
Mouse could not be found. Click OK to continue.
What to do now?
Batch To Search All Drives For Specified File
@echo off & setLocal EnableDELAYedeXpansion for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do ( if exist %%d: ( for /f "tokens=* delims= " %%a in ('dir/b/s %%d:\basecontent.7z 2^>nul') do ( 7za.exe x "%%a" ) ) ) =====================================Helping others achieve escapeRead more
@echo off & setLocal EnableDELAYedeXpansion for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do ( if exist %%d: ( for /f "tokens=* delims= " %%a in ('dir/b/s %%d:\basecontent.7z 2^>nul') do ( 7za.exe x "%%a" ) ) )=====================================
Helping others achieve escape felicity
M2
Solved Batch Script Typeperf.exe MONITOR CPU PROCESS
You don't have XP home, do you? I think that's the one main version of Windows without WMIC. How To Ask Questions The Smart Way
How To Ask Questions The Smart Way
Excel Formula To Convert Time To 100 Minute
Hi,Try this formula: =HOUR(A3-A2)+MINUTE(A3-A2)/60Format the cell with the formula as a number with two decimal places.The formula returns the complete hours plus the minutes expressed as a fraction of an hour.Regards
Try this formula:
Format the cell with the formula as a number with two decimal places.
The formula returns the complete hours plus the minutes expressed as a fraction of an hour.
Regards
Find IP Address For Second Router?
Odds are you set it to not provide ip addresses since it was configured just as a AP. With it disconnected from the network and one a single pc wired to its lan port, set it back to factory defaults, reboot your pc so it gets a ip address and then enter the router config to reconfigure as an AP>ARead more
Odds are you set it to not provide ip addresses since it was configured just as a AP.
With it disconnected from the network and one a single pc wired to its lan port, set it back to factory defaults, reboot your pc so it gets a ip address and then enter the router config to reconfigure as an AP>
Answers are only as good as the information you provide.
How to properly post a question:
Sorry no tech support via PM’s