Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim LastCol As Integer
- Dim CurRow As Integer
- Private Sub UpdateCells()
- Dim Col As Variant
- Dim ColumnOrder As Range
- 'Range that specifies data entry order'
- Set ColumnOrder = Range("A3:A15")
- LastCol = LastCol + 1
- If LastCol > WorksheetFunction.CountA(ColumnOrder) Then
- LastCol = 1
- CurRow = CurRow + 1
- End If
- Col = Range("A3").Offset(0, LastCol)
- Range(Col & CurRow) = TextBox1.Value
- TextBox1 = ""
- End Sub
- Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
- If KeyCode = 13 Then
- UpdateCells
- End If
- End Sub
- Private Sub UserForm_Initialize()
- CurRow = ActiveCell.Row
- End Sub
- Function FindLastRow()
- 'Assuming that data starts in A1'
- r = ActiveSheet.UsedRange.Rows.Count
- c = ActiveSheet.UsedRange.Columns.Count
- FindLastRow = r
- End Function
- Sub LastRow()
- LastRowA = ExecuteExcel4Macro("GET.DOCUMENT(10)")
- LastRowB = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
- End Sub
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim sText As String
- Application.EnableEvents = True
- If Target.Column = 1 Then 'Four digits entered in col A
- sText = CStr(Target.Value) 'convert to string
- If Len(sText) = 4 Then
- Target.Offset(0, 4).Value = Left$(sText, 1) 'write to E
- Target.Offset(0, 3).Value = Mid$(sText, 2, 1) 'D
- Target.Offset(0, 5).Value = Mid$(sText, 3, 1) 'F
- Target.Offset(0, 6).Value = Mid$(sText, 4, 1) 'G
- End If
- End If
- Application.EnableEvents = True
- End Sub
- =VALUE(MID(Inputs,N,1))
Add Comment
Please, Sign In to add comment