Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simple IF problem | Excel Worksheet Functions | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple problem | New Users to Excel | |||
Simple problem I'm sure | New Users to Excel | |||
Simple problem | Excel Discussion (Misc queries) |