+ Reply to Thread
Results 1 to 7 of 7

Deleting columns based on date from InputBox

  1. #1
    Registered User
    Join Date
    04-14-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Deleting columns based on date from InputBox

    Hi all,

    In trying to automate a reporting process, I have gotten stuck on what I thought was going to be an easy step

    I am trying to have an InputBox get a reporting date from the user and then delete the entire columns of the 6 dates that do not match. The code I have returns no error, but also does nothing after getting the input from the user. I have modified things here and there, but just can't get it to work right. Anyone see something I'm missing?

    Attached is a screen shot of a sample layout that I'm referring to and here is the code I've been working with...

    Please Login or Register  to view this content.

    wsSnip.JPG
    Last edited by ph03n1x; 05-30-2014 at 11:17 AM. Reason: code tags

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Deleting columns based on date from InputBox

    Can you attach a sample?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Deleting columns based on date from InputBox

    Please use code tags when posting. See if this helps?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-14-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Deleting columns based on date from InputBox

    sorry about that - edited it for the code box

    Your changes work, however the column with the matching date column is also being deleted. I'm thinking it has to do with the fact that the cells containing the dates are formulas?

    =(DATEVALUE("4/20/2014")-3) for example

    btw, thank you for such a quick response

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Deleting columns based on date from InputBox

    Maybe:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-14-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Deleting columns based on date from InputBox

    That did the trick! Thanks for you help!

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Deleting columns based on date from InputBox

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9.


    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ 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] Deleting multiple columns based on columns' first row value
    By {=OR(value=array)} in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2014, 04:00 PM
  2. Macro to plot graph based on date from inputbox
    By reesjordan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-30-2013, 07:52 AM
  3. deleting rows based on value in columns.
    By barksmith in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-28-2009, 12:21 PM
  4. Deleting selected rows using InputBox?
    By deeppurple247 in forum Excel General
    Replies: 8
    Last Post: 01-28-2007, 02:37 PM
  5. Deleting Columns Based upon Heading
    By Jessica in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2005, 07:10 PM

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