Can u post a sample workbook with dummy data so that i can have a look at that..
I have written this code for sheet module... may be thats the reason for error..
Try changing Range to activesheet.range(..
Shijesh Kumar
http://shijesh.wordpress.com/
Here is the workbook. However you will need to run the script below the one we are working with to populate the combo box for some reason the data keeps going away.
Thanks for your help, Mike
try this one
![]()
Private Sub ComboBox1_Change() Dim r As Integer Dim c1 As Integer Dim c2 As Integer r = 77 + ComboBox1.ListIndex If r <> 76 Then c1 = 3 c2 = 14 Set source_range = Range(Cells(r, c1), Cells(r, c2)) Set destination_range = Range(Cells(26, c1), Cells(26, c2)) source_range.Copy destination_range.PasteSpecial xlValues End If End Sub
Working Now... Thank You for your input. I'm still amazed out how good you guys are!!!
Here is the code I ended up with to get what I needed.
Once again that you for your help!!!! Mike
![]()
Private Sub ComboBox1_Change() Dim r As Integer Dim R2 As Integer Dim c1 As Integer Dim c2 As Integer r = 77 + ComboBox1.ListIndex R2 = 102 + ComboBox1.ListIndex If r <> 76 Then c1 = 3 c2 = 14 Set source_range = Range(Cells(r, c1), Cells(r, c2)) Set destination_range = Range(Cells(26, c1), Cells(26, c2)) source_range.Copy destination_range.PasteSpecial xlValues Set source_range = Range(Cells(R2, c1), Cells(R2, c2)) Set destination_range = Range(Cells(54, c1), Cells(54, c2)) source_range.Copy destination_range.PasteSpecial xlValues End If End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks