+ Reply to Thread
Results 1 to 8 of 8

Need VBA code to fill header values and drag formula till end of last row on target column

Hybrid View

MicroTees Need VBA code to fill header... 10-19-2022, 01:08 AM
JohnTopley Re: Need VBA code to fill... 10-19-2022, 01:40 AM
MicroTees Re: Need VBA code to fill... 10-19-2022, 02:05 AM
Sintek Re: Need VBA code to fill... 10-19-2022, 04:35 AM
MicroTees Re: Need VBA code to fill... 10-19-2022, 04:40 AM
Sintek Re: Need VBA code to fill... 10-19-2022, 04:53 AM
seercoven Re: Need VBA code to fill... 10-19-2022, 05:02 AM
MicroTees Re: Need VBA code to fill... 10-20-2022, 04:33 PM
  1. #1
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    O365 V2408
    Posts
    15,138

    Re: Need VBA code to fill header values and drag formula till end of last row on target co

    I only took over where John left off...Glad to have contributed...Tx for rep +
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  2. #2
    Forum Contributor
    Join Date
    08-27-2015
    Location
    Singapore
    MS-Off Ver
    Office 2021, Office 365
    Posts
    170

    Re: Need VBA code to fill header values and drag formula till end of last row on target co

    I just drop by and saw this. I've notice there's some typo and mismatch in john formula. Since most search feature are case sensitive, text like CAMPBELL SOUP COMPANY may not be detected by the search/find feature. Maybe you can try using this as formula.
    =IF(OR(ISNUMBER(SEARCH("(Y)",F2)),ISNUMBER(SEARCH("(Y1)",F2))),"NT-BDEALER","NON NT-BDEALER")
    Or this formula if you have a fixed search text range containing (Y) or (Y1) which in my case is K2:K3
    =IF(SUMPRODUCT(--ISNUMBER(SEARCH($K$2:$K$3,F2)))>0, "NT-BDEALER", "NON NT-BDEALER")
    Final VBA code with thanks to sintek
    Sub J3v16()
        With Sheets("Master_Data").Cells(1).CurrentRegion.Resize(, 24)
            .Cells(1, 22).Resize(, 3) = Array("Date", "Name", "ISIN code")
            With .Offset(1).Resize(.Rows.Count - 1)
                .Columns(7).Formula = "=IF(OR(ISNUMBER(SEARCH(""(Y)"",F2)),ISNUMBER(SEARCH(""(Y1)"",F2))),""NT-BDEALER"",""NON NT-BDEALER"")"
                .Columns(22).Resize(, 3).Formula = Array("=TODAY()-5", "=IFERROR(VLOOKUP(J2,vlookup!A:B,2,0),"""")", "=E2")
            End With
            .Columns.AutoFit
        End With
    End Sub
    Last edited by seercoven; 10-19-2022 at 05:33 AM.

  3. #3
    Forum Contributor
    Join Date
    06-10-2014
    Location
    CANADA
    MS-Off Ver
    2016
    Posts
    118

    Re: Need VBA code to fill header values and drag formula till end of last row on target co

    Thanks Boss, great help!! Solved @Seecoven and @sintex.

+ 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. need vba code to fill formula where cursor start till end of result in header value
    By MicroTees in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2021, 12:03 PM
  2. [SOLVED] VBA to fill formula down till last row in column.
    By hkbhansali in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 07-12-2018, 04:27 PM
  3. [SOLVED] VBA to fill formula down till last row in column
    By Wither125 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-25-2016, 06:03 PM
  4. How to drag the formula till the end of the data in previous column
    By winmaxservices1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2015, 03:04 AM
  5. [SOLVED] vba to fill values till end of text values in B:B column.
    By johnodys in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2014, 03:06 AM
  6. vba help to delete the column till values met desired header
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-14-2014, 07:32 AM
  7. [SOLVED] Identify the last filled row in Column A and then drag formula in Column B till the same
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-13-2012, 10:50 AM

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