Hi Everyone,
I have a problem with writing a macro code in Excel about data transfer between pages. I have a file that contains different features of 4 different products. I would like to compare those products in a seperate sheet, also I want this features to change according to a drop-down list.
For example in sheet 3 and 4 there are info about 2 different car companies. I want to compare their products in sheet 2 according to the horse power (horse power will be in the ddl.) So, when I change the horse power I want the data I get from Sheets 3 and 4 to change.
I have tried a couple things myself too. I managed to get the data from 1 sheet, but could not expand it. Also when I change the ddl value, the data of prev. ddl value's do not disappear. New one's came on top of it. So how is it possible to do this? How can i include all four sheets for the comparison? And remove the prev. values from the sheet when I change the ddl values.
I am really new at this Excel and Vba stuff. I am also posting the code I've been working on. Please can you help me? I am really under stress about this file, it would be great if one you guys could help me to fix the code.
[#]Code:
Sub test()
Dim aa As String
Dim i, j As Integer
aa = Sayfa1.Cells(1, 1)
i = 4
j = 2
Do While Worksheets(aa).Cells(i, 8) <> ""
If Worksheets(aa).Range("h" & i).Value = Sayfa1.Cells(1, 5) Then
Worksheets(aa).Range("b" & i & ":" & "x" & i).Copy
Sayfa2.Range("a" & j & ":" & "o" & j).PasteSpecial
j = j + 1
End If
i = i + 1
Loop
End Sub
[#]
Bookmarks