On Oct 11, 3:55 am, Tom Ogilvy <TomOgi...@discussions.microsoft.com>
wrote:
> ballnumber = Sheets("sheet4").Range("b2").Value
>
> then the ballnumber variable will hold the value in sheet4!B2 when the
> assignment was made and you can replace NumColumns with BallNumber
>
> --
> regards,
> Tom Ogilvy
>
>
>
> "LongBeachGuy" wrote:
> > I am trying to use the BallNumber instead of NumColumns in
>
> > Destination:=Worksheets("sheet1").Cells(NumRows, NumColumns)
>
> > I want to use this statement
>
> > Destination:=Worksheets("sheet1").Cells(NumRows, BallNumber)
>
> > BallNumber is an integer variable. It should come from
>
> > Sheets("sheet4").Range("b2").Value while it is the activecell.
>
> > How do I attach the Sheets("sheet4").Range("b2").Value to be
> > represented by the integer variable BallNumber?
>
> > ---------------------------------------------------------------------------*------------------------------------------------------------------
>
> > Dim RowCounter As Integer
> > Dim ColumnCounter As Integer
> > Dim rw As Range
> > Dim Colu As Range
> > Dim NumRows As Integer
> > Dim NumColumns As Integer
> > Dim BallNumber As Integer
> > Dim NewRange As Range, Range1 As Range, Range2 As Range
> > Dim Game_Date(202) As Date
> > Dim Games(57) As Integer
> > Dim Game As Variant
> > Dim CopyRange As Range
> > Dim PICKLE As Variant
> > Range("a1").Select
> > Call Setting_Up_Ball_Page
> > Sheets("sheet4").Activate
> > Range("B2").Select
> > Set NewRange = Range("b2:g202")
> > RowCounter = 2
> > ColumnCounter = 1
> > NumColumns = NewRange.Columns.Count
> > NumRows = NewRange.Rows.Count
> > Range(Selection, Selection.End(xlDown)).Select
> > Range(Selection, Selection.End(xlToRight)).Select
> > Range("b2").Select
> > For NumRows = 2 To NumRows
> > For NumColumns = 1 To NumColumns
> > MsgBox "Row number: " & NumRows & " Column number: " &
> > NumColumns
> > Set BallNumber = ActiveCells(NumRows, NumColumns).Value
> > MsgBox Sheets("sheet4").Range("b2").Value & " ballnumber
> > is: " & BallNumber
> > Range("b2").Select
> > Sheets("sheet4").Cells(NumRows, NumColumns).Copy _
> > Destination:=Worksheets("sheet1").Cells(NumRows, _
> > NumColumns)
> > MsgBox ActiveCell.Value
> > Next NumColumns
> > Next NumRows- Hide quoted text -
>
> - Show quoted text -
thank youo sir for your help
|