D
Dean
I have a macro that selects a range of data on one sheet, selects an other
sheet, finds the next available row and pastes the data in. This has worked
!I've seen it and was happy.
I've started to add another seperate routine to cater for single rows of
data on the original sheet and I'm now getting an error.....
Run-time error '1004'
Application-defined or object-defined error
Really strange thing is that it's appearing in different places through out
the code (F8 stepping through).
Private Sub CommandButton1_Click()
' *******************************
' ****** Import Bradley *********
' *******************************
Sheets("Import sheet").Range("A7").Select
If IsEmpty(Range("A8").Value) Then Single_Row_Bradley: Exit Sub
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Bradley").Range("A7").Select
Selection.End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Import Sheet").Select
Range("A7").Select
Application.CutCopyMode = False
End Sub
Private Sub Single_Row_Bradley()
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Bradley").Parent.Activate
Sheets("Bradley").Select
Range("A7").Select
Selection.End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Import Sheet").Select
Range("A7").Select
Application.CutCopyMode = False
End Sub
Two sub routines to prety much do the same but one is for a range of data
the second only deals with a single row.
Any and all help would be appreciated.
Thanks
sheet, finds the next available row and pastes the data in. This has worked
!I've seen it and was happy.
I've started to add another seperate routine to cater for single rows of
data on the original sheet and I'm now getting an error.....
Run-time error '1004'
Application-defined or object-defined error
Really strange thing is that it's appearing in different places through out
the code (F8 stepping through).
Private Sub CommandButton1_Click()
' *******************************
' ****** Import Bradley *********
' *******************************
Sheets("Import sheet").Range("A7").Select
If IsEmpty(Range("A8").Value) Then Single_Row_Bradley: Exit Sub
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Bradley").Range("A7").Select
Selection.End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Import Sheet").Select
Range("A7").Select
Application.CutCopyMode = False
End Sub
Private Sub Single_Row_Bradley()
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Bradley").Parent.Activate
Sheets("Bradley").Select
Range("A7").Select
Selection.End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Import Sheet").Select
Range("A7").Select
Application.CutCopyMode = False
End Sub
Two sub routines to prety much do the same but one is for a range of data
the second only deals with a single row.
Any and all help would be appreciated.
Thanks