LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Put data in cells

I have a vba function as follows:

Function zputData()
Dim cell As Range

Set Range1 = ActiveSheet.Range("a1:a7")
For Each cell In Range1.Cells
cell.Value = "abc"
Next
End Function

If i put =zputData() in A10 I get a #VALUE! and do not get abc in cells a1 to a7.

If i execute abc= zputData() in the immediate window, a1 to a7 gets set.

What am I doing wrong?

Thanks,
Fred


 
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
compare 2 column cells and return the adjacent columns cells data of the cell trebor57 Excel Worksheet Functions 1 February 1st 11 02:54 PM
join data in multiple cells when adjoining cells match criteria ?? angiec50 Excel Worksheet Functions 1 October 6th 09 10:27 AM
Need to average data if in cells, but ignore blank cells. Paula Excel Worksheet Functions 4 July 1st 09 05:38 PM
Returning data of multiple cells for lookup of mulltiple cells HELP on data reference formulas Excel Discussion (Misc queries) 1 October 29th 08 08:27 PM
trying to create an (almost) circular formula between cells and data validated cells with lists KR Excel Worksheet Functions 0 May 12th 05 07:21 PM


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