Hi,
I want to copy the below data in column B and paste it in the SQL sheet inside the round bracket ( ).
For ex: It should first filter and select only 1 in Column C and copy the data in Column B and paste it in the SQL sheet Line14 inside round bracket(). Then filter and select 2 in Column C and copy the data in Column B and paste it in the next SQL query inside round bracket() and so repeat it till the last line no in column C.
SP1.PNG
SQL Sheet:
sql.PNG
Output excepting to be :
sqlOutput.PNG
i tired it with the below code. But i want to iterate until the last line in Column C(SET).
Sub Test()
Selection.AutoFilter
ActiveSheet.Range("$A$1:$C$25").AutoFilter Field:=3, Criteria1:="1"
Range("B2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("SQL").Select
Range("A14").Select
Selection.Insert Shift:=xlDown
End Sub
You can download the file from here http://www.filedropper.com/grptest
Thank you in Advance!![]()
Bookmarks