Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Adding a counter to ranges

worked like a charm thanks.


Norman Jones wrote:
Hi W,

Perhaps something like:

'=============
Public Sub Tester001()
Dim counter As Long

For counter = 1 To 20
ActiveSheet.Cells(counter, "A").Value = counter
Next counter
End Sub
'<<=============



--
---
Regards,
Norman



"wmureports" wrote in message
oups.com...
What i want to do is insert data into a range of rows. But instead of
staticly typing the rows I want them to be determined dynamically
through a counter variable. Heres and example of my code.

Dim counter As Integer

counter = 0

Do While counter < 20
counter = counter + 1

ThisWorkbook.Worksheets("Sheet1").Range("A1:A20") = counter
Loop


So instead of A1:A20 It will be A*counter value*:A*counter value*. My
problem is I dont know the proper syntax to add the actual counter
variable into to range


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 Counter to column for number of identical file numbers Sam Excel Discussion (Misc queries) 1 September 16th 08 06:48 PM
adding ranges [email protected] Excel Discussion (Misc queries) 2 November 21st 05 04:22 PM
adding two ranges Monique Excel Programming 9 July 15th 05 04:25 PM
Adding ranges Bryan via OfficeKB.com Excel Programming 3 February 25th 05 03:06 AM
Adding a counter to a User Form in Excel Pam Excel Programming 2 August 17th 04 02:55 PM


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