+ Reply to Thread
Results 1 to 28 of 28

Put =today if visible

  1. #1
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Put =today if visible

    Hello all, i need help on 1 issue.

    I have a column that has subtotal(109,a1:a1) to check if visible.

    Then i need to create a macro that if subtotal = 1 (row visible) then puts in another column value today. But the data base is constantly increasing which means that the macro needs to do probably a while till subtotal different then empty.

    How can i do this?

    Please let me Know if u need more info

  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: Put =today if visible

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    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
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    Quote Originally Posted by xladept View Post
    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Check file in Attach, i need a macro for that, but there will columns inserted everytime (only cell A1 will have ALWAYS value, that's why subtotal is in it)
    and autofilters will be applied, just have to check while column D has value 1, put in same row at column b the today value.

    Get back to me asap
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    Although this value has to become as value i don't want that the cell to be =Today, cuz it need to be a fixed day and not change once i open the value.

    The solution is to select and copy cells in the same position only for value.

    Please help me out on this.

  5. #5
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    Quote Originally Posted by xladept View Post
    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Any idea to solve my problem i would be very thankful.

    Thank you

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

    Re: Put =today if visible

    Hi Brainzip,

    I'm not understanding what you need so I'm putting your problem before the contributor community

  7. #7
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    My problem is Simple to understand.

    I have 2 columns, 1 with number "1" and "0" . If the number im column 1 is equal to "1" then insert in column 2 (same row) the formule "=today()"

    Then since i just want the value of today and not formule, i need to copy and paste values of visible cells.

    Can someone help?

  8. #8
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Put =today if visible

    Quote Originally Posted by brainzlp View Post
    ......
    Can someone help?

    . I can not understand what you want

    . Please see Post #2.. ( Post # 2 is the second Post in this Thread - the first reply you got from xladept ) Scroll up to seee it........

    ... what he said was....

    . It would helpful if you show
    . 1 ) a sheet similar to what you have, but maybe with test data reflecting all possible scenarios.
    and
    . 2 ) a sheet which you change or fill in manually so that it looks exactly as it the first sheet should look after the running of any macro we do for you
    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Put =today if visible

    For your example workbook, I think you just want:
    Please Login or Register  to view this content.
    This may actually be more than you need however as it assumes the values can change. Note that it looks to the underlying value, not the formula. Formula changes do not trigger the worksheet change event

  10. #10
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Put =today if visible

    Quote Originally Posted by Kyle123 View Post
    For your example workbook, I think you just want:........

    .. ?... my guess would have been the OP wants something like this... but I am still not too sure... ( Can you mind read ? )

    Please Login or Register  to view this content.

  11. #11
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Put =today if visible

    Ah yes, missed that that was a date - the funky format threw me off:

    Please Login or Register  to view this content.
    That's right alan, but a formula change doesn't trigger the change event

  12. #12
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    Hello all,

    Tomorrow i will so both sheets so you can better understand this simple task i want. Although the 1 that shows in the column is the result of subtotal formule to determine visible cells....

    I will probably opt for a while column cellvalue is =1 then offset(-2,0) and cellvalue=today after all that copy ALL visible cells and paste as values

    Some help with that solution?

  13. #13
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Put =today if visible

    So you just want to loop through an put the date in the relevant column if there's a 1 in the cell? You do realise that the subtotal isn't doing anything right?

    I'll have alook tomorrow for you

  14. #14
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    Yes do a loop on one column( which is only 1 IF Subtotal is applied) and if found put value of today date in other column (same row) but after that i need to copy visible cells on date column and paste as value otherwise once i open workbook it puts today but i dont want that, i want a fixed date.

    So.. To conclude, i agree with you except that the subtotal is needed.

    Thanks in advanced.

    P. S. The objective of this is to put the date of order emission to production.

  15. #15
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Put =today if visible

    I think you want:

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select KylesSuperDuperSub in the list
    3. Click the Run button

  16. #16
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    That code doesn't work for what i need.

    I pasted a new attach that will show you better what's the need.
    I need to check if column D has the value 1 or not. If yes put TODAY date.
    Otherwise do nothing, let the the cell as is.

    After inserting the date, then it should be as value, and not =today formule, since i don't want that the cell value each day has a different value. Witch means i need to select.copy then paste as value.

    Hope someone can help me.
    Quote Originally Posted by Kyle123 View Post
    I think you want:

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select KylesSuperDuperSub in the list
    3. Click the Run button
    Attached Files Attached Files

  17. #17
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Put =today if visible

    What exactly doesn't that code do? It doesn't use formulas and puts today's date in the relevant cell. If you can tell me what it doesn't do I can help

  18. #18
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Put =today if visible

    OK,
    . I do try you understand can to
    .
    . Yes . It very simple is think I do
    .
    . But you to understand very difficult to can is
    .
    . Let me try you explain
    . you this gave did

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    1
    MAPA DE PRODUÇAO EM CURSO DE ENVELOPES 2015
    2
    3
    4
    5
    6
    Nº de Entrada
    DATE
    ML Totais da encomenda
    7
    1
    1
    8
    2
    1
    Folha1

    And this

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    2
    3
    4
    Nº de Entrada
    DATE
    ML Totais da encomenda
    5
    3
    17.Ago.15
    1
    6
    4
    17.Ago.15
    1
    Folha2

    ......??? that no sense make can!

    ..........................

    So I guess do now you this want do have can better is

    I say you this have first no want do

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    2
    3
    4
    Nº de Entrada
    DATE
    ML Totais da encomenda
    5
    3
    1
    6
    4
    1
    7
    5
    0
    8
    6
    1
    Folha2

    ... but this want have yes please:

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    4
    Nº de Entrada
    DATE
    ML Totais da encomenda
    5
    3
    17-Aug-15
    1
    6
    4
    17-Aug-15
    1
    7
    5
    0
    8
    6
    17-Aug-15
    1
    Folha2
    ......
    Now I do you code for that to have can. ( Sub brainWank() )

    Please Login or Register  to view this content.

    . My brainWank good ?
    Alansos
    Last edited by Doc.AElstein; 08-17-2015 at 04:41 PM.

  19. #19
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Put =today if visible

    P,s.

    . Yes Kyle is Sub also good is have to


    Please Login or Register  to view this content.


    .. have a Sub KylesSuperDuperWank you want also good is
    Last edited by Doc.AElstein; 08-17-2015 at 04:50 PM.

  20. #20
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516
    Quote Originally Posted by Kyle123 View Post
    What exactly doesn't that code do? It doesn't use formulas and puts today's date in the relevant cell. If you can tell me what it doesn't do I can help
    It has to be able to put in everycell today date. I tried the code that you can see in file attach (last post) and didnt post date in all (1s) 2 columns to left.

    Have you tried and downloaded my last post?

  21. #21
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516
    I didnt understand nothing you said. But your images are perfect. Thata what i want. I will test both codes again and will update my post comment. Thanks

  22. #22
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Put =today if visible

    Quote Originally Posted by brainzlp View Post
    ......
    Have you tried and downloaded my last post?
    Hey Brain___

    . have you seen and read have Posts #18 and Post #19
    Last edited by Doc.AElstein; 08-17-2015 at 04:54 PM. Reason: Trying to perfect language for Brain Wank. He makes my brain ache. I go wank do now better is

  23. #23
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Put =today if visible

    Quote Originally Posted by brainzlp View Post
    I didnt understand nothing ..... your images are perfect. Thata what i want. ...... Thanks
    Great.
    Glad I got the message across
    Last edited by Doc.AElstein; 08-17-2015 at 05:12 PM.

  24. #24
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516
    Quote Originally Posted by Doc.AElstein View Post
    Hey Brain___

    . have you seen and read have Posts #18 and Post #19
    I dont understand what you're writting. I am writting in a portuguese phone with swipe digitalization and some words go with errora like (thatA > that's)

    Thanks for your help. Sooner i have my computer with me i will test both codes and check if in activecell =1 the result in offset(0,-2) is today date in value. On all range till the last value..

  25. #25
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    Already solved my problem with a little twist on your codes.

    Thanks for all your help.

    Ended like this:
    Please Login or Register  to view this content.

  26. #26
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Put =today if visible

    Quote Originally Posted by brainzlp View Post
    Already solved my problem with a little twist on your codes.....
    Glad we did get there answer right was in the End is good enit?
    .

    Thanks for letting us Know and sharing your final Results

  27. #27
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Put =today if visible

    Already solved my problem with a little twist on your codes.

    Thanks for all your help.

    Ended like this:
    Please Login or Register  to view this content.
    I tried doing a loop but loop doesn't work when i filter columns.. so solution is as told.

    Thank you all

  28. #28
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Put =today if visible

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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: 10
    Last Post: 09-06-2023, 08:19 PM
  2. Select visible range and add page break after every 20th visible cell
    By tuc47285 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-04-2015, 01:18 AM
  3. Replies: 4
    Last Post: 01-06-2014, 02:14 AM
  4. Table Object after filtering - Count visible rows & First visible row
    By limalf in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-13-2013, 07:29 PM
  5. Replace today() with a hardcoded value representing today in all tabs
    By Romanian37 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2013, 07:03 AM
  6. Resize Visible Rows based only on Visible Columns text
    By Zimbo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2009, 10:55 AM
  7. Replies: 3
    Last Post: 12-11-2007, 01:36 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