Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
end if befor end select
error end if without block if ' use comment on end if an no responce from code? WOW copied code comp[letely as posted "Jim Thomlinson" wrote: Try something more like... Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal target As Range) 'Dim wksSummary As Worksheet 'Dim rngPaste As Range If target.Cells.Count < 1 Then Exit Sub Select Case Sh.Name Case "Data", "Motorcycle", "Indian", "Native" '1=data 6=Motorcycle 7=Indian 8=Native nbrs If target.Column = 10 And target.Value 10 Then Call CopyStuff(target) End If End Select End Sub Public Sub CopyStuff(ByVal target As Range) Dim wksSummary As Worksheet Dim rngPaste As Range Set wksSummary = Sheets("Donors") Set rngPaste = wksSummary.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) rngPaste.Value = target.Value rngPaste.Offset(0, 1) = target.Offset(0, -1) End Sub -- HTH... Jim Thomlinson "Curt" wrote: here is complete code of this novice Want entry in any cell in column 'J' over $10.00 to trigger this code.Column 'J' is only column set to currency. Donors sheet that data will transfer to has first row frozen for labels & scrolling. Do we need to insert a row to paste ? Thanks much for your help Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal target As Range) 'Dim wksSummary As Worksheet 'Dim rngPaste As Range Select Case Sh.Name Case "Data", "Motorcycle", "Indian", "Native" '1=data 6=Motorcycle 7=Indian 8=Native nbrs If target.Column = 10 And target.Value 10 Then Call CopyStuff(Sh, target) End If End Select Public Sub CopyStuff(ByVal Sh As Worksheet, ByVal target As Range) Dim wksSummary As Worksheet Dim rngPaste As Range Set wksSummary = Sheets("Donors") Set rngPaste = wksSummary.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) rngPaste = target.Value rngPaste.Offset(0, 1) = target.Offset(0, -1) End Sub "Dave Peterson" wrote: Dim myArr as variant myArr = activesheet.range("a1:c9").value works ok. merjet wrote: I suspect it works if 'target' is one cell, but if 'target' is more than one cell, it doesn't. A collection of cells has no Value property; only individual cells do. Hth, merjet -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
multiple file uploading - runtime error'13': type mismatch "While Counter <= UBound(FName)" | Excel Discussion (Misc queries) | |||
Type Mismatch: array or user defined type expected | Excel Programming | |||
Type Mismatch | Excel Programming | |||
Type mismatch using rnge as Range with Type 8 Input Box | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming |