Hi all,
I've gotten a long way with my application, but now it's generating an error
to which I know no response. I hope any of you can (and will) help me. Below
is the code. It's a simple piece of code which should select a flexible
range (one column wide) on one worksheet and copy it to another. Where
things go wrong is in the last part of the code, for some reason the range
is not selected properly. I've tried adding quotation marks to it, but that
generates an error upon leaving the line. How do I get the proper selection
for copying?
Thanks in advance,
Punky
Public Sub StandOpmaken()
Dim stLaatsteRace As String
Dim iDeelnemers As Integer
Dim iBereik As Integer
Dim stUitslag As String
Dim stPunten As String
Worksheets("Deelnemers").Activate
iDeelnemers = ActiveSheet.Range("K1").Value
iBereik = 3 + iDeelnemers 'returns 12, which is OK
stUitslag = ("A4, A" & iBereik) ' returns A4, A12, which it should
stPunten = ("M4, M" & iBereik) 'teturns M4,M12 as expected
' totaalstand kopiëren
ActiveSheet.Range(stUitslag).Copy _
Destination:=Worksheets("Stand").Range("a1")
ActiveSheet.Range(stPunten).Copy _
Destination:=Worksheets("Stand").Range("b1")
Worksheets("Stand").Range("uitslag").Sort _
key1:=Worksheets("Stand").Columns("B"), _
order1:=xlDescending, _
header:=xlYes
--
Punky
Leven is leven dat leven wil te midden van leven dat leven wil (dr. A.
Schweitzer)