G
garygoodguy
Hi, I have the following code to take figures from a hidden workshee
and to place them into specific cells in a visible worksheet in the sam
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 hav
about 100+ rows that will need to be pulled across to the destinatio
sheet. My question is is there a better way to do this than my approac
above? The "GetValues" are all in one continuous block but th
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
and to place them into specific cells in a visible worksheet in the sam
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 hav
about 100+ rows that will need to be pulled across to the destinatio
sheet. My question is is there a better way to do this than my approac
above? The "GetValues" are all in one continuous block but th
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