Enter Date while range selected

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
Say rows 22:35 are selected and column K needs todays date in each of the cells from K22:K35 that a macro could do that? The rows would vary each time eg. next time could be 36:72 or 36:36 etc.
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,831
Office Version
  1. 365
Platform
  1. Windows
If you wanted to put the date in column K of the selected row try this.
Code:
Intersect(Selection.EntireRow, Range("K:K")).Value = Date
 

NeonRedSharpie

Well-known Member
Joined
Jul 14, 2014
Messages
1,678
Code:
Sub dateSelection()

    For Each cell In Selection
        Cells(cell.Row, 11).Value = Date
    Next


End Sub

Yes
 

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
Thank you both. Very nice. Could the same apply if there is a cell with text eg. A1 and that it could also enter that while in column L of the range the same way? It could be a named cell if that would help.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,831
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Sorry I don't follow what you mean.

Do you meant put the value from A1, or a named cell, into column L of the selected rows?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,831
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

All you need to change is the column and the source.
Code:
Intersect(Selection.EntireRow, Range("L:L")).Value = Range("A1").Value
 

Papi

Well-known Member
Joined
May 22, 2007
Messages
1,592
Norie. It amazes me how some of you folks have a way to make this stuff look like magic, even to old timers like me.

Just thinking of another workbook, could the same be done with a window opening up and allowing the user to enter something in the window to accomplish the same thing?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,831
Office Version
  1. 365
Platform
  1. Windows
Do you mean something to allow the user to enter the data?
 

Watch MrExcel Video

Forum statistics

Threads
1,109,445
Messages
5,528,800
Members
409,835
Latest member
Mafu1267

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top