Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Translating Column Addresses into number/integer

Hi - I have a for.. next loop that I want to shuttle across columns based on
a supplied cell ref... how do I increment form column to collumn?

For instance I want to move, in a row, allong the columns and when I find an
integer put it else where on the sheet

I thought it might look something like this:

for zz = 1 to 5 ' The rows
for xx = A to G 'The cols
do stuff
next xx
next zz

Any help MUCH appreciated!

Cheers

Andrew




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Translating Column Addresses into number/integer

There are many ways - this one is easy as you can use the
variables in lots of ways.

Sub MySub()
For xx = 4 To 9 'ROW
For yy = 6 To 16 'COL
If Range("A1").Offset(xx, yy) = Int(Range("A1").Offset(xx, yy)) Then
Range("AA1").Offset(xx, yy) = Range("A1").Offset(xx, yy)
End If
Next yy
Next xx
End Sub



This will check cells from F4:P9 to see if they are integers (they must be numbers)
and save the integers into the same cells in the range AF:AP9.

Chrissy.

"Andreww" wrote in message ...
Hi - I have a for.. next loop that I want to shuttle across columns based on
a supplied cell ref... how do I increment form column to collumn?

For instance I want to move, in a row, allong the columns and when I find an
integer put it else where on the sheet

I thought it might look something like this:

for zz = 1 to 5 ' The rows
for xx = A to G 'The cols
do stuff
next xx
next zz

Any help MUCH appreciated!

Cheers

Andrew






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Translating Column Addresses into number/integer

Chrissy - many thanks - I'll give this a ago. It's far more elegent than my
rather ham solution.

Regards

Andrew

"Chrissy" wrote in message
...
There are many ways - this one is easy as you can use the
variables in lots of ways.

Sub MySub()
For xx = 4 To 9 'ROW
For yy = 6 To 16 'COL
If Range("A1").Offset(xx, yy) = Int(Range("A1").Offset(xx, yy)) Then
Range("AA1").Offset(xx, yy) = Range("A1").Offset(xx, yy)
End If
Next yy
Next xx
End Sub



This will check cells from F4:P9 to see if they are integers (they must be

numbers)
and save the integers into the same cells in the range AF:AP9.

Chrissy.

"Andreww" wrote in message

...
Hi - I have a for.. next loop that I want to shuttle across columns

based on
a supplied cell ref... how do I increment form column to collumn?

For instance I want to move, in a row, allong the columns and when I

find an
integer put it else where on the sheet

I thought it might look something like this:

for zz = 1 to 5 ' The rows
for xx = A to G 'The cols
do stuff
next xx
next zz

Any help MUCH appreciated!

Cheers

Andrew








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
check if a number is integer or fraction Munir from Qatar New Users to Excel 2 April 5th 23 02:54 PM
Your entry cannot be used. An integer or decimal number may be req JLB Excel Discussion (Misc queries) 2 March 17th 10 05:24 PM
Select range using row and column number addresses NDBC Excel Discussion (Misc queries) 4 July 22nd 09 06:51 AM
Translating a letter to a number within an array Echoball Excel Worksheet Functions 1 August 21st 08 03:27 AM
Identifiyng an integer number from a floating one Jepane Excel Discussion (Misc queries) 1 June 14th 07 11:27 PM


All times are GMT +1. The time now is 06:30 PM.

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"