Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VBA Excel 2000 - one shot multiple cells modification

Hi,

In a Excel 2000 sheet, I'm looking for a way to modify
multiple cells content in one function call. For example,
I want to obtain the following Excel 2000 sheet values:

A B C

1 Q W E
2 R T Y
3 U I O

It has to be done from a single function call from VBA in
a module.

Being a VB programmer but new to VBA, I am at a loss to
achieve that.

I tried variations of the following code without success:

public sub CreateMatrix()
dim i as long
For i = 1 to 100
ActiveCell.Offset(i, 1).Value = "Any data"
Next i
end sub

I get "Error 1004: Error defined by application or object"
(this is a rough translation from the french error
message "Erreur d'exécution 1004: Erreur définie par
l'application ou par l'object"). I only get the message
when I step into the code and debug manually. At run-
time, the message "#Value!" appears in the current cell
from where the function is called.

Thanks for any help you can provide,

C.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default VBA Excel 2000 - one shot multiple cells modification

I'm pretty certain that user defined functions will only return values for
the cell that it occupies, and will not change values of other cells

You could run it as a macro, or link it to a button.

Dan E

"Conceptor" wrote in message
...
Hi,

In a Excel 2000 sheet, I'm looking for a way to modify
multiple cells content in one function call. For example,
I want to obtain the following Excel 2000 sheet values:

A B C

1 Q W E
2 R T Y
3 U I O

It has to be done from a single function call from VBA in
a module.

Being a VB programmer but new to VBA, I am at a loss to
achieve that.

I tried variations of the following code without success:

public sub CreateMatrix()
dim i as long
For i = 1 to 100
ActiveCell.Offset(i, 1).Value = "Any data"
Next i
end sub

I get "Error 1004: Error defined by application or object"
(this is a rough translation from the french error
message "Erreur d'exécution 1004: Erreur définie par
l'application ou par l'object"). I only get the message
when I step into the code and debug manually. At run-
time, the message "#Value!" appears in the current cell
from where the function is called.

Thanks for any help you can provide,

C.


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
Excel 2000 - Split Contents of Cell Across Multiple Cells DeeW Excel Discussion (Misc queries) 7 November 8th 06 09:10 PM
inserting multiple rows in one shot? Greg Excel Discussion (Misc queries) 3 June 28th 06 07:26 PM
Create multiple data series for a chart in one shot... ronbrosh111 Charts and Charting in Excel 5 June 6th 06 06:16 PM
Show the defined name of cells, help with modification of this UDF Bol Excel Worksheet Functions 7 March 3rd 06 12:55 PM
Print a screen shot in Excel? Teacher1 Excel Discussion (Misc queries) 6 January 13th 05 07:01 PM


All times are GMT +1. The time now is 03:05 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"