Hello,
I think Geoff (xlbo) wrote this code for me a while back and it works very well.
But.....
I,ve changed things slightly and needs some help!
In column U I have values say 01 to 40. Before I run this code I sort the worksheet by order of this column and them add subtotals at changes in this column.
Previously I wanted the code to select copy data from columns B to D, but now I want it to select copy columns B,C, & E.
A text box is used to select was data to copy, if for example U5 to U15 was all value 04 and I select 04 in the text box and run the code it would select B5 to D15, but I now want B, C & E.
There is however a small problem with the existing code in that if the select value is only on 1 row it select copies + the Subtotal row + 1 extra row.
LRIS = Range("B" & rng.Row).End(xlDown).Row
Range("B" & rng.Row & ":e" & LRIS).Select
Selection.Copy
'x = 0
'For i = 1 To Range("u65536"
.End(xlUp).Row
'If Range("u" & i).Text = ComboBox1.Text Then
' If x < 1 Then
' rgSel = "B" & i & ":e" & i
' Else
' rgSel = rgSel & ",B" & i & "e" & i
'End If
'x = x + 1
'Else
'End If
'Next i
'Range(rgSel).Select
'Selection.Copy
Confused - I know I am
Please help!
Thanks
Andrew
I think Geoff (xlbo) wrote this code for me a while back and it works very well.
But.....
I,ve changed things slightly and needs some help!
In column U I have values say 01 to 40. Before I run this code I sort the worksheet by order of this column and them add subtotals at changes in this column.
Previously I wanted the code to select copy data from columns B to D, but now I want it to select copy columns B,C, & E.
A text box is used to select was data to copy, if for example U5 to U15 was all value 04 and I select 04 in the text box and run the code it would select B5 to D15, but I now want B, C & E.
There is however a small problem with the existing code in that if the select value is only on 1 row it select copies + the Subtotal row + 1 extra row.
LRIS = Range("B" & rng.Row).End(xlDown).Row
Range("B" & rng.Row & ":e" & LRIS).Select
Selection.Copy
'x = 0
'For i = 1 To Range("u65536"
'If Range("u" & i).Text = ComboBox1.Text Then
' If x < 1 Then
' rgSel = "B" & i & ":e" & i
' Else
' rgSel = rgSel & ",B" & i & "e" & i
'End If
'x = x + 1
'Else
'End If
'Next i
'Range(rgSel).Select
'Selection.Copy
Confused - I know I am
Please help!
Thanks
Andrew