+ Reply to Thread
Results 1 to 4 of 4

Search Heading and copy first cell under heading

  1. #1
    Registered User
    Join Date
    12-15-2014
    Location
    Wales, UK
    MS-Off Ver
    365
    Posts
    66

    Search Heading and copy first cell under heading

    I have to search a specific Heading (row 51) and then copy the first cell under the heading to a different cell (B10) on the same sheet. All the data under that heading are the same date. I've tried to code it but it says 'Object variable or With block variable not set'.


    Dim rngDateHeader As Range
    Dim rngHeaders As Range
    Set wb1 = Application.ActiveWorkbook
    Set ws1 = wb1.Sheets("Summary")
    Set rngDateHeader = ws1.Rows(51).Find("SDC Date", , xlValues, xlWhole)

    If Not rngDateHeader Is Nothing Then
    rngDateHeader.Offset(1, 0).Copy
    ws1.Range("B10") = rnbDateHeader
    End If
    Last edited by Simone Fick; 07-20-2017 at 10:35 AM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Search Heading and copy first cell under heading

    Try:


    Please Login or Register  to view this content.
    *N.B. The misspelling is unnecessary

    Or just

    Please Login or Register  to view this content.
    Last edited by xladept; 07-19-2017 at 06:16 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    12-15-2014
    Location
    Wales, UK
    MS-Off Ver
    365
    Posts
    66

    Re: Search Heading and copy first cell under heading

    It worked perfectly, thank you!

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Search Heading and copy first cell under heading

    You're welcome and thanks for the rep!

+ 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. Replies: 5
    Last Post: 07-26-2016, 09:16 AM
  2. [SOLVED] Determine if heading is within range of +-15 of another heading
    By magnus.blomquist in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-06-2016, 12:16 PM
  3. Replies: 0
    Last Post: 10-25-2014, 11:28 AM
  4. [SOLVED] Look for a certain heading but if not found then move to next heading you are after.
    By Steve2107 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-03-2014, 03:02 AM
  5. [SOLVED] Search for heading in data sheet and copy range to corresponding sheet in master workbook
    By sans in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-07-2012, 10:02 AM
  6. [SOLVED] Sub-heading stuck at same heading number
    By Hallet in forum Word Formatting & General
    Replies: 1
    Last Post: 06-01-2012, 08:16 AM
  7. [SOLVED] In a table produce an value by column heading and row heading
    By naflan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-27-2005, 01:25 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