+ Post New Thread
Results 1 to 4 of 4
Coding Thread, [EXCEL VBA] Insert a value or formula into empty cells in a range in Coding and Web Development; I'm just looking at a spreadsheet for our personnel department and after having heard a quick grumble from another member ...
  1. #1

    Join Date
    Nov 2007
    Location
    Rotherham
    Posts
    1,679
    Thank Post
    122
    Thanked 126 Times in 102 Posts
    Rep Power
    46

    [EXCEL VBA] Insert a value or formula into empty cells in a range

    I'm just looking at a spreadsheet for our personnel department and after having heard a quick grumble from another member of staff want to make it a bit easier for the end user.

    It's a timesheet where the user fills in when they are in, off ill and so on (Image attached)SSheet.jpg. To minimise the work of the end user I want to have them fill in the Off/Sick etc then have a button that looks at all the cells in the range and fills in the "I" in any cell that doesn't contain a value already. if possible I would also only like it to put values in cells where there is a member of staff and an actual day (i.e Febuary will only go up to the 28th and whilst my spreadsheet will automatically remove the 29/30/31 if if you set the month to "2" I don't want "I"'s what will be columns AD-AF

    Any suggestions would be gratefully received.

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,824
    Thank Post
    372
    Thanked 544 Times in 507 Posts
    Rep Power
    184
    Two questions, a) Can you upload the sheet (If it's not got private data), easier to edit on it than remake it

    and b) When you say "in the range" are you only doing 1 row at a time? or "every" cell in the black line.

    Steve

  3. #3

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,824
    Thank Post
    372
    Thanked 544 Times in 507 Posts
    Rep Power
    184
    Test this and see if it works, Will need to change a few settings in it like where your table starts etc but should work as you want.

    Will fill in all blanks, only if the date exists above it, and will stop if no user name present.

    test for stu.zip

    (Had to Zip it due to forum blocking macro enabled worksheets (and remember to unblock macros )

    Steve

  4. #4

    Join Date
    Nov 2007
    Location
    Rotherham
    Posts
    1,679
    Thank Post
    122
    Thanked 126 Times in 102 Posts
    Rep Power
    46
    Cool. I'lll have a quick look this afternoon, got to do some other work first rather than haveing fun with Excel



SHARE:
+ Post New Thread

Similar Threads

  1. Find a file in excel VBA
    By Stuart_C in forum Coding
    Replies: 15
    Last Post: 10th May 2011, 04:10 PM
  2. Excel VBA Issues suppress propmt
    By Stuart_C in forum Coding
    Replies: 2
    Last Post: 4th May 2011, 10:26 AM
  3. Excel VBA Issues
    By dataoverride in forum Coding
    Replies: 5
    Last Post: 23rd September 2009, 03:16 PM
  4. Excel VBA problems
    By cursong in forum Coding
    Replies: 1
    Last Post: 13th October 2008, 12:28 PM
  5. Excel VBA Loop Question
    By vunsev in forum Coding
    Replies: 5
    Last Post: 11th April 2008, 09:08 AM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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