Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Sub Sample()
Dim i As Long, LastRow As Long
LastRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow Step 5
'~~> Your code here
Next i
End Sub
ublic Sub Rows_FillMissingValsCoordinate()
'------------------------------------------------------------------------------
'
'
'------------------------------------------------------------------------------
Dim lLastRow As Long
Dim l As Long
Dim m As Long
Dim vInfo As Variant
Dim dVariance As Double
Dim dLong As Double
Dim dLat As Double
Dim lWay As Long
'Dim n As Integer
'Dim p As Integer
'''''''''''''''''''''''''''''''''''''''
lLastRow = LastXlCell(ActiveSheet).Row 'find last row
vInfo = ActiveSheet.Range("A1", "C" & CStr(lLastRow)) 'get range of info
For l = 2 To UBound(vInfo, 1) - 5 'start at row 2 since top is header
If Len(vInfo(l, 1)) > 0 Then
dLong = (vInfo(l, 1) - vInfo(l + 5, 1)) / 5
dLat = (vInfo(l, 2) - vInfo(l + 5, 2)) / 5
lWay = CLng(Mid$(vInfo(l, 3), 2))
For m = 1 To 4
ActiveSheet.Cells(l + m, 1) = vInfo(l, 1) - (m * dLong) 'long
ActiveSheet.Cells(l + m, 2) = vInfo(l, 2) - (m * dLat) 'lat
ActiveSheet.Cells(l + m, 3) = "E" & lWay + m
Next m
l = l + 4
End If
Next l
End Sub
Public Function LastXlCell(ByRef xlWs As Worksheet) As Range
'------------------------------------------------------------------------------
'
'
'
' Error-handling is in case there is not any data in the worksheet
'------------------------------------------------------------------------------
Dim LastRow&, LastCol%
'''''''''''''''''''''''''''''''''''''''
On Error Resume Next
With xlWs
' Find the last real row
LastRow& = .Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
' Find the last real column
LastCol% = .Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByColumns).Column
End With
' Finally, initialize a Range object variable for
' the last populated row.
Set LastXlCell = xlWs.Cells(LastRow&, LastCol%)
End Function
Sub Sample()
Dim i As Long, LastRow As Long
Dim ATemp As Double, BTemp As Double
With Sheets("A Route")
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow - 5 Step 5
ATemp = (.Range("A" & i + 5).Value - .Range("A" & i).Value) / 5
.Range("A" & i).Offset(1).Value = .Range("A" & i).Value + ATemp
.Range("A" & i).Offset(2).Value = .Range("A" & i).Offset(1).Value + ATemp
.Range("A" & i).Offset(3).Value = .Range("A" & i).Offset(2).Value + ATemp
.Range("A" & i).Offset(4).Value = .Range("A" & i).Offset(3).Value + ATemp
BTemp = (.Range("B" & i + 5).Value - .Range("B" & i).Value) / 5
.Range("B" & i).Offset(1).Value = .Range("B" & i).Value + BTemp
.Range("B" & i).Offset(2).Value = .Range("B" & i).Offset(1).Value + BTemp
.Range("B" & i).Offset(3).Value = .Range("B" & i).Offset(2).Value + BTemp
.Range("B" & i).Offset(4).Value = .Range("B" & i).Offset(3).Value + BTemp
.Range("C" & i).AutoFill Destination:=.Range("C" & i & ":C" & i + 4), Type:=xlFillDefault
Next i
End With
End Sub
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.