+ Reply to Thread
Results 1 to 2 of 2

VBA find function to copy data under a heading

Hybrid View

  1. #1
    Registered User
    Join Date
    12-03-2019
    Location
    Berlin
    MS-Off Ver
    2016
    Posts
    23

    Question VBA find function to copy data under a heading

    Hey All!

    I am trying to figure out a way to copy the data under a heading and to paste it to another tab. Maybe the VBA find function?

    In this case the heading is "origin". The column this information is in will change every time but the heading will stay the same.

    Hoping someone can help with this!

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,713

    Re: VBA find function to copy data under a heading

    Hi bkav1991,

    Try below code ...
    Sub test()
    
    Dim Rg As Range
    
    With Sheets("Information")
       Set Rg = .Rows(1).Find("Origin")
       If Not Rg Is Nothing Then Range(.Cells(2, Rg.Column), .Cells(Rows.Count, Rg.Column).End(3)).Copy Sheets("Paste").Cells(1)
    End With
    
    End Sub
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

+ 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. [SOLVED] copy table from website -heading ok but data misses col A
    By gilnic in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-01-2018, 05:55 AM
  2. [SOLVED] Search Heading and copy first cell under heading
    By Simone Fick in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2017, 06:21 PM
  3. Replies: 5
    Last Post: 07-26-2016, 09:16 AM
  4. [SOLVED] As Per Heading copy data from Input to Output Workbook
    By rr1050 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2014, 06:11 AM
  5. Custom function to find Heading & Subheading
    By Meesam_ali in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2014, 11:27 AM
  6. [SOLVED] Macro to copy data under appropriate heading
    By anthony_91 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-02-2013, 10:11 PM
  7. macro to find text heading then select underlying data?
    By excelRookie06 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-07-2011, 12:31 PM

Tags for this Thread

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