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: 10
Default Change to existing macro

Hi,
I have a macro (see below) that the copies and pastes 5
arrays of assumptions, line by line, into the assumptions
input sheet of a model. It then records the output of the
model based on that particular set of assumptions. Now, I
would like to make the following change to the macro, but
I am not certain how:

The five arrays of assumptions are in sheet1 columns N
through Q. I would like be able to manipulate the macro,
so column N variables goes into a specific cell (Let's say
B31), column O goes into another specific cell independent
of column N (Let's say B61), and so forth. Right now the
macro simply copies and pastes a range of cells.

I hope this makes sense.

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 Paste:=xlValues,
Transpose:=True
cell.Offset(0, -5).Value = .Range("B9").Value
cell.Offset(0, -4).Value = .Range("B10").Value
cell.Offset(0, -3).Value = .Range("B11").Value
cell.Offset(0, -2).Value = .Range("B12").Value

End With


Next

End Sub
 
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
how do I change existing colours on a sheet? richarf Excel Discussion (Misc queries) 0 August 27th 07 11:42 AM
how to change existing column to capital letters fredg Excel Discussion (Misc queries) 3 January 16th 07 05:24 PM
How to change an existing query Gireeshm Excel Discussion (Misc queries) 0 July 18th 06 12:33 PM
how to change font for all existing comments at once? robynkedwards Excel Worksheet Functions 1 March 7th 06 04:56 PM
How do I change from all caps to regular for existing data? CL Johnson Excel Discussion (Misc queries) 1 June 9th 05 04:49 AM


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