Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Another simple little problem

Hi,
This program takes values from 5 arrays, pastes them (line
by line) into a model, then picks up the bottom line of
the model and pastes this bottom line into some results
columns. Here the problem: The model has 4 output numbers
(sheet2 B8:B11). However, the macro only picks up these 4
numbers for the first input line (row 6). After this, the
macro only picks up the number in sheet1 cell B8 (and not
B9:B11 as it is intended to do). What is wrong with the
macro?
Thanks,
Jerry

Sub Model()


Dim cell As Range

For Each cell In Worksheets("sheet1").Range("N6:N325")
cell.Resize(1, 5).Copy


With Worksheets("sheet2")

.Range("B2").PasteSpecial Transpose:=True
cell.Offset(0, -5).Value = .Range("B8:B11").Value

End With


Next

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Another simple little problem

cell.Offset(0, -5).Resize(4,1).Value = .Range("B8:B11").Value

--
Regards,
Tom Ogilvy


Jerry wrote in message
...
Hi,
This program takes values from 5 arrays, pastes them (line
by line) into a model, then picks up the bottom line of
the model and pastes this bottom line into some results
columns. Here the problem: The model has 4 output numbers
(sheet2 B8:B11). However, the macro only picks up these 4
numbers for the first input line (row 6). After this, the
macro only picks up the number in sheet1 cell B8 (and not
B9:B11 as it is intended to do). What is wrong with the
macro?
Thanks,
Jerry

Sub Model()


Dim cell As Range

For Each cell In Worksheets("sheet1").Range("N6:N325")
cell.Resize(1, 5).Copy


With Worksheets("sheet2")

.Range("B2").PasteSpecial Transpose:=True
cell.Offset(0, -5).Value = .Range("B8:B11").Value

End With


Next

End Sub



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
Simple IF problem Trevor Aiston[_2_] Excel Worksheet Functions 0 September 12th 09 03:18 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple problem excelnovice1 New Users to Excel 3 June 29th 06 11:19 AM
Simple problem I'm sure John New Users to Excel 1 February 15th 06 01:37 AM
Simple problem inquirer Excel Discussion (Misc queries) 4 April 16th 05 12:37 PM


All times are GMT +1. The time now is 08:43 AM.

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"