Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: VBA find header and clear contents

  1. #1

    Join Date
    May 2014
    Posts
    597
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default VBA find header and clear contents

    Hi good people!,

    Please assist me with this:

    Sheet1 = Database
    Sheet2 =View

    Sheet "Database" has the following:

    A1 = "01-01-2019"
    A2 = "Handle"
    B2 = "Win"
    C2 = "Games"
    D2 = "Theo Hold"

    Then E1 = "02-01-2019"
    E2 = "Handle"
    F2 = "Win"
    G2 = "Games"
    H2 = "Theo Hold"

    and so the pattern goes.

    The columns with headers "Handle", "Win", "Games" and "Theo Hold", contain data underneath them going down to row 512. I am looking for a code please that will, once the button is clicked, give a msgbox prompting the date from where I want to clear data, then allow me to input for example "05-04-2019", after which the code will find the date in the Database sheet, find the cell in row 3 below this date, select from this cell down to row 512 and also select all cells going to the right, then clear all that content. The button will be on the View sheet.

    I hope I have explained my need properly. please help me with this?..all help will be greatly appreciated!..Thank you kindly..

  2. #2
    Board Regular Tim_Excel_'s Avatar
    Join Date
    Jul 2016
    Posts
    512
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    4 Thread(s)

    Default Re: VBA find header and clear contents

    Look into UserForms, TextBoxes or ComboBoxes, and go from there.

    Please note this is not a free code writing service, if you come up with some code and get stuck we can help you get going.
    Always make a backup of your data before trying out any code

    Before you ask why my code is not working: have you checked if the references are correct? Are you referring to the correct Workbook/-sheet?

    Use [CODE] tags when pasting code in your posts

  3. #3

    Join Date
    May 2014
    Posts
    597
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA find header and clear contents

    WOW!!..

    this is new....always used to get help here...okay, well, if no help is available anymore, I might as well quit this forum. Thanx..

  4. #4
    Board Regular Tim_Excel_'s Avatar
    Join Date
    Jul 2016
    Posts
    512
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    4 Thread(s)

    Default Re: VBA find header and clear contents

    You're asking us to construct a completely new UserForm with code that performs the actions you mentioned without providing a starting point or any code you have tried/written beforehand.

    I'm giving you a starting point to read into, so you can start writing and then come back if you run into any problems. See it as a "This is my problem, could you help?", instead of "Write my project for me" issue.
    Always make a backup of your data before trying out any code

    Before you ask why my code is not working: have you checked if the references are correct? Are you referring to the correct Workbook/-sheet?

    Use [CODE] tags when pasting code in your posts

  5. #5
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,812
    Post Thanks / Like
    Mentioned
    48 Post(s)
    Tagged
    6 Thread(s)

    Default Re: VBA find header and clear contents

    There is NO requirement for people to have done any prior work. If you don’t want to answer a post, then don’t, but it is not your place to tell themwhat they should or shouldn’t be doing here.

  6. #6
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,812
    Post Thanks / Like
    Mentioned
    48 Post(s)
    Tagged
    6 Thread(s)

    Default Re: VBA find header and clear contents

    @juriemagic,

    Notwithstanding my prior post, you should know the forum rules on cross-posting by now. Please comply with them.

  7. #7

    Join Date
    May 2014
    Posts
    597
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA find header and clear contents

    RoryA,

    Yes I do know the rules, and I apologise. I will remove the post from excel help. I did that post as a result of me getting a mouthful from someone who obviously did not know what he was talking about. I actually expected me to be removed by the moderators. so, since it sounds like I just might get help on my issue, I will gladly remove the post as I indicated. Thanx RoryA

  8. #8

    Join Date
    May 2014
    Posts
    597
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA find header and clear contents

    will the board please remove my account. thanx.

  9. #9
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,812
    Post Thanks / Like
    Mentioned
    48 Post(s)
    Tagged
    6 Thread(s)

    Default Re: VBA find header and clear contents

    We don't delete accounts. You can just stop using it or, if you like, we can deactivate it for you, though I'm not really sure why you would want/need us to?

  10. #10

    Join Date
    May 2014
    Posts
    597
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA find header and clear contents

    I'm trying to delete my account, or deactivate or whatever i can do just not to be a part of this forum anymore. i cannot seem to do it as a regular user, therefore my request.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •