Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Julie(sheetName As String, firstColumn As String, columnCount As Integer, firstRow As Integer, rowCount As Integer, dstFirstRow As Integer, dstFirstCol As String)
- Dim firstColumn_int As Integer
- Dim lastColumn_int As Integer
- Dim temporaryRow As Integer
- Dim temporaryCol_int As Integer
- Dim templateText As String
- 'Dim level As Long
- Dim count As Integer
- Dim dstFirstCol_int As Integer
- Dim firstRow_int As Integer
- Dim destinationColumn As Integer
- Dim containsCharacters As Boolean
- count = 0
- firstColumn_int = Convert_Column_ToNumber(firstColumn)
- dstFirstCol_int = Convert_Column_ToNumber(dstFirstCol)
- lastColumn_int = firstColumn_int + columnCount
- firstRow_int = dstFirstRow
- For temporaryRow = firstRow To firstRow + rowCount - 1
- count = 1
- For temporaryCol_int = firstColumn_int To lastColumn_int - 1
- containsCharacters = False
- templateTxt = Sheets(sheetName).Cells(temporaryRow, temporaryCol_int).Value
- If Not IsEmpty(templateTxt) Then
- ' daca count <= 5, atunci crestem dstFirstCol cu 1
- ' daca count >= 6, crestem cu lastColumn_int - 1 - count
- destinationColumn = computeColumn(dstFirstCol_int, count)
- Sheets(sheetName).Cells(firstRow_int, dstFirstCol_int).Value = count
- Sheets(sheetName).Cells(firstRow_int, destinationColumn).Value = templateTxt
- End If
- count = count + 1
- Next
- firstRow_int = firstRow_int + 1
- Next
- End Function
- Function computeColumn(firstColumnNo As Integer, count As Integer) As Integer
- If (count <= 5) Then
- computeColumn = firstColumnNo + 1
- Exit Function
- Else
- computeColumn = firstColumnNo + (count - 5) + 1
- End If
- End Function
- Sub Functie()
- Call Julie(AnalogSwitchesSheet, "AB", 7, 28, 30, 28, "T")
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement