PC Review


Reply
Thread Tools Rate Thread

Activecell and integers

 
 
LongBeachGuy
Guest
Posts: n/a
 
      11th Oct 2007
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      11th Oct 2007
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
>
>

 
Reply With Quote
 
LongBeachGuy
Guest
Posts: n/a
 
      21st Oct 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get 32-bit Integers? Renny Bosch Microsoft Access 3 13th Mar 2010 05:52 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Microsoft Excel Misc 1 2nd Oct 2007 08:05 PM
How to Revert to ActiveCell.Formula = format from ActiveCell.FormulaR1C1 = format Karthik Bhat - Bangalore Microsoft Excel Programming 1 9th May 2007 02:37 PM
A list of Consecutive Integers, can I search for missing integers =?Utf-8?B?Q00=?= Microsoft Excel Worksheet Functions 4 2nd Sep 2005 06:38 PM
arrays of integers =?Utf-8?B?cm9kY2hhcg==?= Microsoft VB .NET 5 1st Oct 2004 10:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:55 PM.