from Column b to column dw in another sheet

A

~Alan

XL2000
I am using this code in sheet 3
  how can I get the information from sheet 3 column B
 to sheet 2 column dw +1

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
   If Target.Column = 1 Then
    If ActiveCell <> "" Then RangeSelection = ActiveCell.Value
    Range(Range("E1")) = ActiveCell.Value
    End If
 End Sub

this is in E1  ="B1"&COUNTA(B:B)+1
 
 
 
D

Dave Peterson

Column DW+1 = DX????


Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Column = 2 Then
If Target.Value <> "" Then
Worksheets("sheet2").Cells(Rows.Count, "DX").End(xlUp) _
.Offset(1, 0).Value = Target.Value
End If
End If
End Sub

You really want this tied to the change of selection?
 
A

~Alan

I am sorry maybe i wasn't very clear in my statement so i will try to very pacific.
&nbsp;on sheet named (parts) column A is a list of part numbers. I found a code that when
&nbsp; i select a cell on (parts) in column A&nbsp; the characters in column A will show up in column F1 then when i select another
&nbsp;cell in&nbsp; in column A the characters in column A will show up in column F2 and so on
this formula&nbsp; ="F"&amp;COUNTA(F:F)+1 is in (parts) E1
this is the sheet code
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
&nbsp;&nbsp;&nbsp; If Target.Column = 1 Then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If ActiveCell &lt;> "" Then RangeSelection = ActiveCell.Value
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Range(Range("E1")) = ActiveCell.Value
&nbsp;&nbsp;&nbsp;&nbsp; End If
&nbsp; End Sub

My problem is i need the information in (sheet2) column DR starting at DR2 then when I select another cell on (parts) A
the next number will go to DR3 and so on.
I tried your code and i get an error If Target.Value &lt;> "" Then
I still have alot to learn here :)

Dave Peterson wrote: Column DW+1 = DX????

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
&nbsp;&nbsp; If Target.Column = 2 Then
&nbsp;&nbsp;&nbsp; If Target.Value &lt;> "" Then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Worksheets("sheet2").Cells(Rows.Count, "DX").End(xlUp) _
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..Offset(1, 0).Value = Target.Value
&nbsp;&nbsp;&nbsp; End If
&nbsp;&nbsp; End If
End Sub

You really want this tied to the change of selection?
 
D

Dave Peterson

First, please post in plain text. HTML/Rich text is more difficult for a lot of
old timers to read!

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Column = 2 Then
if iserror(target.value) then
'do nothing, it's an error!
else
If Target.value <> "" Then
Worksheets("sheet2").Cells(Rows.Count, "DR").End(xlUp) _
.Offset(1, 0).Value = Target.value
End If
end if
End If
End Sub

I'm guessing that the value of the selected cell was an error. (target.value
will blow up really good in that case.)

But I'd clean up those errors (if possible).

But you don't reall need that formula to point at the next cell. You can get it
in code.

When you go to DR65536 and hit End and then up arrow. You go to the last used
cell in column DR. The .offset(1,0) drops down one row. That's the cell that
gets the value.
 
A

~Alan

Dave Peterson
Thank you for your help this codes works very well.
&nbsp;&nbsp;&nbsp;&nbsp; The news reader I am using is netscape 4.7&nbsp; and I often forget to change the settings
do you have a suggestion for another news reader that I can use just for this group&nbsp; I do not what to upset anyone

Dave Peterson wrote: First, please post in plain text.&nbsp; HTML/Rich text is more difficult for a lot of
old timers to read!

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
&nbsp;&nbsp; If Target.Column = 2 Then
&nbsp;&nbsp;&nbsp; if iserror(target.value) then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'do nothing, it's an error!
&nbsp;&nbsp;&nbsp; else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Target.value &lt;> "" Then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Worksheets("sheet2").Cells(Rows.Count, "DR").End(xlUp) _
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..Offset(1, 0).Value = Target.value
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If
&nbsp;&nbsp;&nbsp; end if
&nbsp;&nbsp; End If
End Sub

I'm guessing that the value of the selected cell was an error.&nbsp; (target.value
will blow up really good in that case.)

But I'd clean up those errors (if possible).

But you don't reall need that formula to point at the next cell.&nbsp; You can get it
in code.

When you go to DR65536 and hit End and then up arrow.&nbsp; You go to the last used
cell in column DR.&nbsp; The .offset(1,0) drops down one row.&nbsp; That's the cell that
gets the value.
 
D

Dave Peterson

I like netscape. I use netscape.

But I use plain text for (almost) everything.

Lots of people use OutlookExpress.



~Alan said:
Dave Peterson
Thank you for your help this codes works very well.
The news reader I am using is netscape 4.7 and I often forget to change
the settings
do you have a suggestion for another news reader that I can use just for this
group I do not what to upset anyone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top