Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Letter alternative to 1 - 26

I have used the code;

Dim i as integer
For i = 1 to 26

a lot to refer to sheets and rows numbered consequtively. However I am
writing code with the lines below;

ActiveCell.Offset(1, 1) = Sheets("drivers").Range("a1")
ActiveCell.Offset(1, 1) = Sheets("drivers").Range("b1")
ActiveCell.Offset(1, 1) = Sheets("drivers").Range("c1")
ActiveCell.Offset(1, 1) = Sheets("drivers").Range("d1")

And i wondered if there was a way to do a similar thing in this code
with the column letters. I guess it will be a way of referring to the
column instead of having the above code for 35 lines referring to each
column individually. Can anyone suggest the way to but a Next in this
code so I can shorten my macro considerably?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default Letter alternative to 1 - 26

Hi

Dim i As Integer
For i = 1 To 26
ActiveCell.Offset(0, i) = Sheets("drivers").Cells(1, i)
Next


--
Regards

Roger Govier


"keri" wrote in message
oups.com...
I have used the code;

Dim i as integer
For i = 1 to 26

a lot to refer to sheets and rows numbered consequtively. However I am
writing code with the lines below;

ActiveCell.Offset(1, 1) = Sheets("drivers").Range("a1")
ActiveCell.Offset(1, 1) = Sheets("drivers").Range("b1")
ActiveCell.Offset(1, 1) = Sheets("drivers").Range("c1")
ActiveCell.Offset(1, 1) = Sheets("drivers").Range("d1")

And i wondered if there was a way to do a similar thing in this code
with the column letters. I guess it will be a way of referring to the
column instead of having the above code for 35 lines referring to each
column individually. Can anyone suggest the way to but a Next in this
code so I can shorten my macro considerably?



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
Adding a number to a letter of the alphabet to get a letter [email protected] Excel Worksheet Functions 5 May 21st 07 04:25 PM
New Validation option to format 1st letter as Capital letter Jeff Excel Discussion (Misc queries) 5 July 13th 06 05:11 AM
Default Capital letter for 1st letter of a word Jeff Excel Discussion (Misc queries) 6 July 10th 06 08:36 AM
column header changed from letter to number, how return to letter Ron Excel Discussion (Misc queries) 2 May 9th 05 08:34 PM
press letter and go 2 entry begin w letter in data validation drop MCP Excel Programming 1 August 28th 04 05:07 PM


All times are GMT +1. The time now is 02:08 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"