Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Private Sub FetchNoRowCol(ws As Excel.Worksheet, ByRef NoOfRows As Long, _ ByRef NoOfColumns As Long) ' Error-handling is here in case there is not any ' data in the worksheet. On Error Resume Next NoOfRows = ws.Cells.Find(What:="*", SearchDirection:=xlPrevious, _ SearchOrder:=xlByRows).Row NoOfColumns = ws.Cells.Find(What:="*", SearchDirection:=xlPrevious, _ SearchOrder:=xlByColumns).Column End Sub Private Sub Command1_Click() Dim xlObject As Excel.Application Dim xlWB As Excel.Workbook Dim NoOfRows As Long Dim NoOfColumns As Long With CommonDialog1 .CancelError = True .Filter = "Microsoft Excel files (csv)" .InitDir = "C:\Documents and Settings\all users\Desktop" .ShowOpen If Not .FileName = "" Then Set xlObject = New Excel.Application Set xlWB = xlObject.Workbooks.Open(.FileName) Clipboard.Clear xlObject.Cells.Copy ' Copy all cells in active worksheet. FetchNoRowCol xlObject.ActiveWorkbook.ActiveSheet, NoOfRows, NoOfColumns With MSHFlexGrid1 .Redraw = False 'Dont draw until the end, so we avoid that flash .Rows = NoOfRows .Cols = NoOfColumns .Row = 0 'Paste from first cell .Col = 0 .RowSel = .Rows - 1 'Select maximum allowed (your selection shouldnt be greater than this) .ColSel = .Cols - 1 .Clip = Replace(Clipboard.GetText, vbNewLine, vbCr) 'Replace carriage return with the correct one .Col = 1 'Just to remove that blue selection from Flexgrid .Redraw = True 'Now draw End With xlObject.DisplayAlerts = False 'To avoid "Save woorkbook" messagebox xlWB.Close xlObject.Application.Quit Set xlWB = Nothing Set xlObject = Nothing End If End With End Sub
|change vba from autofit to 13.5 width?||4||29|
|Change the path of the data source in my Excel pivot table with macro||4||47|
|to transfer string from C lanaguage to VBA||4||72|