Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Find non blank cell in range and fill the rest with that value

There is only one non-blank cell in a given range; I need to populate the
rest of that range with that value. The cell containing the value could be
anywhere in that range so I cant use fill down, up, etc by default.

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Find non blank cell in range and fill the rest with that value

Select the range and then:

Sub FillRange()
v = ""
For Each r In Selection
If r.Value < v Then
v = r.Value
Exit For
End If
Next
Selection.Value = v
End Sub

--
Gary''s Student - gsnu200801


"LuisE" wrote:

There is only one non-blank cell in a given range; I need to populate the
rest of that range with that value. The cell containing the value could be
anywhere in that range so I cant use fill down, up, etc by default.

Thanks in advance

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find last non-blank cell in range Eric Excel Discussion (Misc queries) 11 February 11th 09 07:31 PM
VBA code to fill rest of cell with dashes (-) mikeburg[_97_] Excel Programming 2 August 18th 06 12:58 AM
Trying to find a way to fill in the rest of a row if it is a dupli Robert Brown Excel Worksheet Functions 2 June 29th 06 05:58 PM
finding the first blank cell and then executing rest of macro Ed[_25_] Excel Programming 1 December 13th 04 07:24 PM
How to find the first blank cell in a range Victor[_3_] Excel Programming 11 November 6th 03 03:20 PM


All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"