Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Fill Searched array with text

I am trying to fill in the word "Blank" across a row array with data
already in it. I want all the cells in teh array to say "blank".

I want to select a cell, then highlight all the data including the
selected cell to the right (i.e. shift/cntrl right arrow). Then I
want to count the number of columns included in the array and assign
that number to a variable.

I am trying this but it doesn't work:

Dim ColumnCount As Integer


Range("DropDownStartCell").Select
Range(Selection, Selection.End(xlToRight)).Select
ColumnCount = ActiveRange.Column.Count

For X = 1 To ColumnCount
Range("DropDownStartCell").Select.Offset(0, X) = "Blank"

Next X


End Sub

Any ideas
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Fill Searched array with text

I'm assuming that "DropDownStartCell" is a named range,

Dim rngDDSC as Range

Set rngDDSC = Range("DropDownStartCell")
Range(rngDDSC , rngDDSC .End(xlToRight)).Value = "Blank"

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
On 24 Sep 2003 10:04:48 -0700, wrote:

I am trying to fill in the word "Blank" across a row array with data
already in it. I want all the cells in teh array to say "blank".

I want to select a cell, then highlight all the data including the
selected cell to the right (i.e. shift/cntrl right arrow). Then I
want to count the number of columns included in the array and assign
that number to a variable.

I am trying this but it doesn't work:

Dim ColumnCount As Integer


Range("DropDownStartCell").Select
Range(Selection, Selection.End(xlToRight)).Select
ColumnCount = ActiveRange.Column.Count

For X = 1 To ColumnCount
Range("DropDownStartCell").Select.Offset(0, X) = "Blank"

Next X


End Sub

Any ideas


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Fill Searched array with text

IfDropDownStartCell were Cell D3 and you had data in D3:H3, what cells
do you want to contain "Blank"? In particular, do you want Cell D3 to
contain "Blank"? Your attempted loop starts with the cell offset 1 cell
to the right.

In any event, you will have better luck if you use something like

Set rng = Range("DropDownStartCell")
Set DataRange = Range(rng, rng.End(xlToRight))
Range(DataRange(1, 2), DataRange(1, DataRange.Count)).Value = "Blank"

This will not enter "Blank" in "DropDownStartCell"; if you want that,
change the 2 to 1.

Alan Beban

wrote:
I am trying to fill in the word "Blank" across a row array with data
already in it. I want all the cells in teh array to say "blank".

I want to select a cell, then highlight all the data including the
selected cell to the right (i.e. shift/cntrl right arrow). Then I
want to count the number of columns included in the array and assign
that number to a variable.

I am trying this but it doesn't work:

Dim ColumnCount As Integer


Range("DropDownStartCell").Select
Range(Selection, Selection.End(xlToRight)).Select
ColumnCount = ActiveRange.Column.Count

For X = 1 To ColumnCount
Range("DropDownStartCell").Select.Offset(0, X) = "Blank"

Next X


End Sub

Any ideas


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Fill Searched array with text

Thanks guys!!
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
Fill in cells with an array dgh Excel Discussion (Misc queries) 0 May 15th 09 08:42 PM
combination searched Mark Excel Worksheet Functions 1 December 6th 08 08:08 AM
fill down array to last available row [email protected] Excel Worksheet Functions 10 May 19th 05 10:52 PM
Additional Columns to be Searched Aviator Excel Discussion (Misc queries) 3 January 28th 05 11:27 PM
Open Searched File Pedro[_4_] Excel Programming 5 July 14th 03 05:42 PM


All times are GMT +1. The time now is 01:00 PM.

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"