+ Reply to Thread
Results 1 to 1 of 1

VBA to Paste data inside the round bracket ( )

  1. #1
    Registered User
    Join Date
    05-16-2016
    Location
    bangalore,India
    MS-Off Ver
    2013
    Posts
    32

    VBA to Paste data inside the round bracket ( )

    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!
    Last edited by Wither125; 08-17-2018 at 05:27 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Loops / Copy / Paste Query
    By carlbrianhadi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2015, 05:39 AM
  2. Macro to copy & paste new data retrieved from web query?
    By caliann49 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2013, 12:43 PM
  3. Web Query dynamic destination or VBA to copy and paste new data alongside existing data
    By Marbleking in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 06:03 PM
  4. Simple copy/paste link query
    By md1972 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-02-2008, 10:58 AM
  5. Copy and paste database query
    By kjewaat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-30-2006, 09:26 AM
  6. Query, copy & paste
    By ThalesNate in forum Excel General
    Replies: 9
    Last Post: 02-02-2006, 10:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1