Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vba Code
Hi!
IŽlocking for a vba code that fill in a column different names. Column A 1Today 2 3 4 Tomorrow 5 6 7 8 So what I wont is a code that fill TODAY till the row 3 and then TOMORROW to the row 8 Thank you Horacio |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vba Code
Horacio, are the figures in column 1 and the names in column 2 or are there no figures? If there aren't how will the code know enough cells have been filled in with each name? what would be the marker for it? Horacio;524875 Wrote: Hi! IŽlocking for a vba code that fill in a column different names. Column A 1Today 2 3 4 Tomorrow 5 6 7 8 So what I wont is a code that fill TODAY till the row 3 and then TOMORROW to the row 8 Thank you Horacio -- Simon Lloyd Regards, Simon Lloyd 'Microsoft Office Help' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=144023 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vba Code
Give this macro a try...
Sub FillInTheBlanks() Dim Blanks As Range, LastRow As Long LastRow = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row For Each Blanks In Range("A1:A" & LastRow).SpecialCells(xlCellTypeBlanks) Blanks.Value = Blanks(1).Offset(-1).Value Next End Sub -- Rick (MVP - Excel) "Horacio" wrote in message ... Hi Simon I attach a image of the sheet. Thank you Horacio Simon Lloyd escreveu: Horacio, are the figures in column 1 and the names in column 2 or are there no figures? If there aren't how will the code know enough cells have been filled in with each name? what would be the marker for it? Horacio;524875 Wrote: Hi! IŽlocking for a vba code that fill in a column different names. Column A 1Today 2 3 4 Tomorrow 5 6 7 8 So what I wont is a code that fill TODAY till the row 3 and then TOMORROW to the row 8 Thank you Horacio |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vba Code
Thank you works perfect
Horacio Rick Rothstein escreveu: Give this macro a try... Sub FillInTheBlanks() Dim Blanks As Range, LastRow As Long LastRow = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row For Each Blanks In Range("A1:A" & LastRow).SpecialCells(xlCellTypeBlanks) Blanks.Value = Blanks(1).Offset(-1).Value Next End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vba Code
are you just wanting to fill down the cells with the contents of the cell
above? For Each c In Worksheets("sheet1").Range("A2:A100") If c.Value = "" Then c.Value = c.Offset(-1, 0) Next The question is at what point do you stop? this only continues until A100 "Simon Lloyd" wrote: Horacio, are the figures in column 1 and the names in column 2 or are there no figures? If there aren't how will the code know enough cells have been filled in with each name? what would be the marker for it? Horacio;524875 Wrote: Hi! IÂŽlocking for a vba code that fill in a column different names. Column A 1Today 2 3 4 Tomorrow 5 6 7 8 So what I wont is a code that fill TODAY till the row 3 and then TOMORROW to the row 8 Thank you Horacio -- Simon Lloyd Regards, Simon Lloyd 'Microsoft Office Help' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=144023 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
How can I modify my code to offset the defined range and repeat theprocedure instead of duplicating my code? | Excel Programming | |||
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does | Excel Programming | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming |