PC Review


Reply
Thread Tools Rate Thread

Change CellA.

 
 
Joergen Bondesen
Guest
Posts: n/a
 
      2nd Dec 2007
Hi NG

I have this macro [simplified]

Sub test()

dim RRange as range
set RRange=Range("A1:A1000")

dim CellA as range
'// Loop 1
for each CellA in RRange
'// CellA = Range("A1")

'// Loop2
dim CellA2 as range
for each CellA2 in rrange.offset(1,0)
'// doing something and now I want CellA to continue with
Range("A10"),
'// I will use a counter and Cells(counter,1)
'// Is it possible, and how ?

'// Next time in loop2 I want CellA=Range("A25")
exit for
next cellA2

'// something like: CellA=Range("A10")
next CellA

--

Best regards
Joergen Bondesen


 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      2nd Dec 2007
I think your codde would be better structuresd like this

RowCountColA = 1
do while RowCountColA <= 1000
CellA = Range("A" & RowCountColA)
RowCountColB = 1
do while RowCountColB <= 1000
CellB = Range("B" & RowCountColB)
RowcountColB = RowCountColB + 1
loop
RowcountColA = RowCountColA + 1
loop


"Joergen Bondesen" wrote:

> Hi NG
>
> I have this macro [simplified]
>
> Sub test()
>
> dim RRange as range
> set RRange=Range("A1:A1000")
>
> dim CellA as range
> '// Loop 1
> for each CellA in RRange
> '// CellA = Range("A1")
>
> '// Loop2
> dim CellA2 as range
> for each CellA2 in rrange.offset(1,0)
> '// doing something and now I want CellA to continue with
> Range("A10"),
> '// I will use a counter and Cells(counter,1)
> '// Is it possible, and how ?
>
> '// Next time in loop2 I want CellA=Range("A25")
> exit for
> next cellA2
>
> '// something like: CellA=Range("A10")
> next CellA
>
> --
>
> Best regards
> Joergen Bondesen
>
>
>

 
Reply With Quote
 
Joergen Bondesen
Guest
Posts: n/a
 
      2nd Dec 2007
Hi Joel.

Thanks.

--

Best regards
Joergen Bondesen


"Joel" <(E-Mail Removed)> skrev i en meddelelse
newsBDC2D60-7BB5-4C72-9177-(E-Mail Removed)...
>I think your codde would be better structuresd like this
>
> RowCountColA = 1
> do while RowCountColA <= 1000
> CellA = Range("A" & RowCountColA)
> RowCountColB = 1
> do while RowCountColB <= 1000
> CellB = Range("B" & RowCountColB)
> RowcountColB = RowCountColB + 1
> loop
> RowcountColA = RowCountColA + 1
> loop
>
>
> "Joergen Bondesen" wrote:
>
>> Hi NG
>>
>> I have this macro [simplified]
>>
>> Sub test()
>>
>> dim RRange as range
>> set RRange=Range("A1:A1000")
>>
>> dim CellA as range
>> '// Loop 1
>> for each CellA in RRange
>> '// CellA = Range("A1")
>>
>> '// Loop2
>> dim CellA2 as range
>> for each CellA2 in rrange.offset(1,0)
>> '// doing something and now I want CellA to continue with
>> Range("A10"),
>> '// I will use a counter and Cells(counter,1)
>> '// Is it possible, and how ?
>>
>> '// Next time in loop2 I want CellA=Range("A25")
>> exit for
>> next cellA2
>>
>> '// something like: CellA=Range("A10")
>> next CellA
>>
>> --
>>
>> Best regards
>> Joergen Bondesen
>>
>>
>>



 
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
comando "Trova" su formati cella e carattere SiNi Microsoft Excel Discussion 2 13th Feb 2009 04:39 PM
Background Images for Table Cell“s in Outlook 2003 Rafael Microsoft Outlook Discussion 0 9th Nov 2008 07:33 PM
Automatic change of cell’s background color Aswathy Microsoft Excel Worksheet Functions 1 11th Mar 2008 05:54 AM
If cellA is blank or 0 then cellB is blank ~Natasha~ Microsoft Excel Worksheet Functions 0 28th Oct 2004 06:40 PM
If cellA is blank or 0 then cellB is blank ~Natasha~ Microsoft Excel Worksheet Functions 2 28th Oct 2004 04:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:37 PM.