Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Activecell and integers

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Activecell and integers

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Activecell and integers

On Oct 11, 3:55 am, Tom Ogilvy
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
How to Revert to ActiveCell.Formula = format from ActiveCell.FormulaR1C1 = format Karthik Bhat - Bangalore[_2_] Excel Programming 1 May 9th 07 02:37 PM
A list of Consecutive Integers, can I search for missing integers CM Excel Worksheet Functions 4 September 2nd 05 06:38 PM
converting to Integers bmordhorst Excel Worksheet Functions 5 January 6th 05 04:55 PM
MOST & LEAST OCCURRING INTEGERS ! flex zax Excel Programming 5 February 1st 04 06:23 AM


All times are GMT +1. The time now is 07:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"