Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default input of single value into multiple cells simultaneously

Hi,

I'm trying to enter a bunch of asterisks into a range of cells (columns
A through I) in a row "i" in a worksheet that has been defined as SHD.
The macro has already "read" the value of i correctly. However, when I
use the following code, it gives me an error code. Could you tell me
what is wrong with this ?

SHD.Range(Cells(i, 1), Cells(i, 9)) = "********"

Appreciate any help.

Thanks,

Joe.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default input of single value into multiple cells simultaneously

SHD.Range(SHD.Cells(i, 1), SHD.Cells(i, 9)) = "********"

or

With SHD
.Range(.Cells(i,1),.Cells(i,9)) = "********"
End With

or
SHD.Cells(i,1).Resize(1,9) = "********"

--

Regards,
Tom Ogilvy


"Joe" wrote in message
oups.com...
Hi,

I'm trying to enter a bunch of asterisks into a range of cells (columns
A through I) in a row "i" in a worksheet that has been defined as SHD.
The macro has already "read" the value of i correctly. However, when I
use the following code, it gives me an error code. Could you tell me
what is wrong with this ?

SHD.Range(Cells(i, 1), Cells(i, 9)) = "********"

Appreciate any help.

Thanks,

Joe.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default input of single value into multiple cells simultaneously

Thanks a lot, Tom. Incidentally, I saw this other option - formulaR1C1,
and used it. I have one more question though - why is it that I have to
define SHD specifically into each of the cells address in:

SHD.Range(SHD.Cells(i, 1), SHD.Cells(i, 9)) = "********"

Thanks,

Joe.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default input of single value into multiple cells simultaneously

If you don't they refer to the Activesheet. Or if you are using them in a
sheet module, the unqualified range reference it interpreted to refer to the
sheet containing the code.

Since you are not assigning a formula, then Value would be more appropriate.
However, the end result will be the same. There is also Formula.

Just for illustration

With Range("A1")
.Formula =
.FormulaR1C1 =
.Value =
.FormulaLocal =
.FormulaR1C1Local =

End With

Don't just grab something out of the hat - look at the help and see which is
appropriate. Sometimes it makes no difference, other times it does.

--
Regards,
Tom Ogilvy


"Joe" wrote in message
oups.com...
Thanks a lot, Tom. Incidentally, I saw this other option - formulaR1C1,
and used it. I have one more question though - why is it that I have to
define SHD specifically into each of the cells address in:

SHD.Range(SHD.Cells(i, 1), SHD.Cells(i, 9)) = "********"

Thanks,

Joe.



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
How to clear multiple cells of input data in Excel simultaneously sstea Excel Worksheet Functions 12 May 2nd 09 08:47 PM
In Excel how do I update cells in multiple sheets simultaneously? kjh1210 Excel Discussion (Misc queries) 1 April 22nd 09 11:01 PM
How do I use multiple worksheets as input for a single pivot tab Larry D Watts Excel Worksheet Functions 1 December 29th 05 05:37 PM
Simultaneously change values in multiple cells? Jaclyn Excel Worksheet Functions 4 July 20th 05 05:24 PM
Pasting single cells from Word to multiple cells in Excel ASBiss Excel Worksheet Functions 1 February 15th 05 11:47 AM


All times are GMT +1. The time now is 07:59 PM.

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

About Us

"It's about Microsoft Excel"