Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi, I have the following code to take figures from a hidden worksheet and to place them into specific cells in a visible worksheet in the same workbook.
Dim ShGet As Worksheet Dim ShDest As Worksheet Dim ShStart As Worksheet Set ShGet = Sheets("GetValues") Set ShDest = Sheets("PasteValues") Set ShStart = Sheets("Start") If ShStart.Range("A1").Value = "one" Then ShDest.Range("F9:AC9").Value = ShGet.Range("C204:Z204").Value ShDest.Range("F15:AC15").Value = ShGet.Range("C207:Z207").Value ElseIf ShStart.Range("P40").Value = "two" Then ShDest.Range("F9:AC9").Value = ShGet.Range("C204:Z204").Value ShDest.Range("F15:AC15").Value = ShGet.Range("C207:Z207").Value ElseIf ShStart.Range("P40").Value = "three" Then ShDest.Range("F9:AC9").Value = ShGet.Range("C204:Z204").Value ShDest.Range("F15:AC15").Value = ShGet.Range("C207:Z207").Value ElseIf ShStart.Range("P40").Value = "four" Then ShDest.Range("F9:AC9").Value = ShGet.Range("C204:Z204").Value ShDest.Range("F15:AC15").Value = ShGet.Range("C207:Z207").Value End If NB: I've only placed two ranges in each if/elseif, but actually I have about 100+ rows that will need to be pulled across to the destination sheet. My question is is there a better way to do this than my approach above? The "GetValues" are all in one continuous block but the destination cells will be placed on specific rows and not (i.e. rows 11, 13, 24, 26, 46, 48, etc). The ranges will not change. Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I copy big ranges of cells without drag or copy/paste? | Excel Discussion (Misc queries) | |||
Copy/Paste dynamic ranges | Excel Programming | |||
copy then paste to multiple ranges | Excel Programming | |||
Copy and paste Named Ranges | Excel Programming | |||
Copy paste ranges from multiple sheets | Excel Programming |