LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help-Simple Sub

I didn't forget a parenthesis. I had a typo.

Dim sh1 as Worksheet, sh2 as Worksheet
Dim cell as Range
set sh1 = Worksheets("Sheet1")
set sh2 = Worksheets("Sheet2")
for each cell in sh2.Range("A2:C2")
cell.Value = cell.Value + sh1.Cells(1,cell.column).Value
Next

Underline key is next to the right paren.

This is copied from a module where it compiled fine.

Option Explicit

Sub efg()
Dim sh1 As Worksheet, sh2 As Worksheet
Dim cell As Range
Set sh1 = Worksheets("Sheet1")
Set sh2 = Worksheets("Sheet2")
For Each cell In sh2.Range("A2:C2")
cell.Value = cell.Value + _
sh1.Cells(1, cell.Column).Value
Next

End Sub

--
Regard

"New to VBA" wrote
in message ...

Peo,
I tried with the added ), still not working. I'm using Excel Version X.
maybe that is the problem?


--
New to VBA
------------------------------------------------------------------------
New to VBA's Profile:

http://www.excelforum.com/member.php...o&userid=30032
View this thread: http://www.excelforum.com/showthread...hreadid=497191



 
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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM


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