Results 1 to 8 of 8

VBA Excel Macro find column name and next need to copy range

Threaded View

  1. #1
    Registered User
    Join Date
    09-17-2021
    Location
    Gdynia
    MS-Off Ver
    2016
    Posts
    66

    VBA Excel Macro find column name and next need to copy range

    I have a part of macro which, after typing in the inputbox, finds the name of the column (date), after finding it, it needs to copy a given fragment of rows from this column, always after finding a given cell, it will be the same range. But i dont knot excatly how please take a look as below code . Here im getting error : Loc.Range("109:123").Copy

    ''' Put date input box  '''
        Do
            inputbx = InputBox("Provide date, FORMAT; YYYY-MM-DD")
            If inputbx = vbNullString Then Exit Sub
            On Error Resume Next
            vDate = CDate(inputbx)
            On Error GoTo 0
            DateIsValid = IsDate(vDate)
            If Not DateIsValid Then MsgBox "Please enter a valid date.", vbExclamation
        Loop Until DateIsValid
    ''' loop'''
         With data_wb.Sheets("Final")
            Set Loc = .Cells.Find(what:=Format(inputbx, "YYYY-MM-DD"))
            If Not Loc Is Nothing Then
    Loc.Select
                Loc.Range("109:123").Copy
    Last edited by Palucci; 09-24-2021 at 06:24 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find Non Blanks in column, copy range to new sheet.
    By marcosis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2019, 07:43 AM
  2. [SOLVED] Excel VBA Macro - Find Word and Select that Column to Column D and copy
    By MsBBStacker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2015, 12:04 AM
  3. Find column name and copy used range under header
    By Pierce Quality in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2015, 04:19 PM
  4. [SOLVED] Macro to find the empty cell in a column and copy a adjacent row to another column.
    By naga in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2013, 07:44 AM
  5. [SOLVED] Excel VBA macro to select range separated by blank row and copy to next empty column
    By hackini in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2013, 02:13 AM
  6. [SOLVED] find bold number in Column A and copy range to column C
    By joek13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-24-2012, 10:32 AM
  7. Replies: 1
    Last Post: 05-06-2011, 03:08 AM

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