+ Reply to Thread
Results 1 to 2 of 2

how to automate this in vgb macro, i have tried chatGPT but it doesn't work

  1. #1
    Registered User
    Join Date
    10-17-2022
    Location
    toronto
    MS-Off Ver
    2021
    Posts
    40

    how to automate this in vgb macro, i have tried chatGPT but it doesn't work

    (please see attached pic below)

    I want to automate copying from cell m2 to m29 , then n2 to n29 ... until cell x29 in one straight column in "sheet2" starting at cell F2. thx


    I found this VBA macro works, but wants know if I can make the Range F2, f30, f58 .... F310 more dynamic ? so far, they are manually calculated , thx

    Sub CopyPaste()
    'Sheets("Sheet1").Select

    Range("M2:M29").Copy Destination:=Range("F2")
    Range("N2:N29").Copy Destination:=Range("F30")
    Range("O2:O29").Copy Destination:=Range("F58")
    Range("P2:P29").Copy Destination:=Range("F86")
    Range("Q2:Q29").Copy Destination:=Range("F114")
    Range("R2:R29").Copy Destination:=Range("F142")
    Range("S2:S29").Copy Destination:=Range("F170")
    Range("O2:O29").Copy Destination:=Range("F198")
    Range("U2:U29").Copy Destination:=Range("F226")
    Range("V2:V29").Copy Destination:=Range("F254")
    Range("W2:W29").Copy Destination:=Range("F282")
    Range("X2:X29").Copy Destination:=Range("F310")
    ' Repeat the above line for any additional ranges you want to copy and paste
    End Sub




    Capture.JPG
    Attached Images Attached Images
    Last edited by fatkinglet; 01-24-2023 at 09:37 AM.

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: how to automate this in vgb macro, i have tried chatGPT but it doesn't work

    go to sheet2 in "F1"
    =Sheet1!M1
    copy paste across.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

+ 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. Using ChatGPT for VBA
    By mogul in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2023, 06:10 AM
  2. macro to automate the opening , saving and closing the work in another program
    By emymeeky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2014, 09:40 AM
  3. [SOLVED] Macro work in personal workbook, doesn't work in other workbooks
    By Centexcel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-30-2013, 11:47 AM
  4. [SOLVED] Macro Doesn't Work Through Button, Does Work Through Developer ->Macros Option
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-27-2013, 11:55 AM
  5. Macro doesn't work
    By liorhen9 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-29-2012, 09:11 AM
  6. Help My Macro Doesn't Work!
    By pinkgoldfish in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2006, 07:57 PM
  7. Macro doesn't work
    By Alan P in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2005, 02:05 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