Quote:
Originally Posted by zomg
Hard to say without seeing the sheet, can you post a screenshot? I'm picturing each row having a date followed by 12 numbers..
You could make a form in vba and lock the spreadsheet then on_open show the form and update the values if there is no value for todays date
ok, so the problem is that i can get my script below to copy my range to my designated worksheet, and save it but i can't make it do individual cells to individual rows.
Basically i'm trying to make it as simple as possible for the people who input these numbers. They already have a form they input the numbers into, but it's not linear, and they input into 5~6 different cells not in common row's or columns.
I want a "Send to XXXX worksheet" Button, that when clicked will copy/paste the numbers into the next empty row in it's respective column.
I have MSN and can probably get other forms of communication if you think it'd be easier to handle that way
Code:
Sub Copy_To_Another_Workbook()
Dim SourceRange As Range
Dim DestRange As Range
Dim DestWB As Workbook
Dim DestSh As Worksheet
Dim Lr As Long
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
If bIsBookOpen_RB("current worksheet") Then
Set DestWB = Workbooks("Current worksheet")
Else
Set DestWB = Workbooks.Open("target workshee")
End If
Set SourceRange = ThisWorkbook.Sheets("Sheet1").Range("A2:D2")
Set DestSh = DestWB.Worksheets("Grains recieving Daily")
Lr = LastRow(DestSh)
Set DestRange = DestSh.Range("A" & Lr + 1)
With SourceRange
Set DestRange = DestRange.Resize(.Rows.Count, .Columns.Count)
End With
DestRange.Value = SourceRange.Value
DestWB.Close savechanges:=True
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = DestSheet.Cells(Rows.Count, "A").End(xlDown).Row
On Error GoTo 0
End Function
Function LastCol(sh As Worksheet)
On Error Resume Next
LastCol = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Column
On Error GoTo 0
End Function