LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Looping letters (or columns)

Just my opinion, but you are headed down a deadend street. What happends if
you want to loop from W to AF? You don't need to get letters involved at
all and **nobody** does it that way.

Public Sub test()
Dim i As Long
Dim c As Long

For i = 19 To 21
If ThisWorkbook.Worksheets("Blad1").Cells(i, 1) = True Then
For c = 8 To 11
destWB.Worksheets("Blad1").Cells(Lr, c) = "X"
Next c
End If
Next
End Sub

--
Regards,
Tom Ogilvy




"JCanyoneer" wrote in message
...
That should do it! Things are pretty easy when you know the code to use.

CHR
is new to me. Thanks!

"Fredrik Wahlgren" wrote:


"JCanyoneer" wrote in message
...
Yes, I think this code will loop my the range in the if statement. I

need
to
be able to loop the Column or letter(H, I, J, K) in range from the

destWB
line.
Does that help clear anything up?


I hope so. Here's my second suggestion

Public Sub test()
Dim i As Long
Dim c As Long

For i = 19 To 21
If ThisWorkbook.Worksheets("Blad1").Range("A" & CStr(i)) = True Then
For c = 72 To 75
destWB.Worksheets("Blad1").Range(Chr(c) & Lr) = "X"
Next c
End If
Next
End Sub

/Fredrik





 
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
Columns now numbers rather than letters how do i get letters back SalExcel10 Excel Discussion (Misc queries) 2 March 4th 10 02:48 PM
looping across columns in range? Amy Excel Discussion (Misc queries) 3 July 19th 05 08:01 PM
Looping through columns teresa Excel Programming 2 December 31st 04 07:25 PM
Looping thru columns beyond Z John Pierce Excel Programming 3 January 23rd 04 12:17 AM
Looping question for 2 columns [email protected] Excel Programming 1 October 24th 03 02:33 PM


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

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

About Us

"It's about Microsoft Excel"