PC Review


Reply
 
 
RobcPettit
Guest
Posts: n/a
 
      30th Oct 2009
Hi, Id like to know if its possible with vba to add number of rows to
a given range so I can then select those cells. If my range is "A3"
and I want to add 30 rows, so A3 + 30 = A3:A33. The number to be
added is not static and changes depending on previous results.
regards Robert
 
Reply With Quote
 
 
 
 
Member
Join Date: Sep 2009
Posts: 45
 
      31st Oct 2009
try this macro

Code:
Sub test()
 Dim r As String, j As Integer, r1 As Range
  r = InputBox("type the range address e.g. A3")
  j = InputBox("type the no. of rows you want to offset .e.g 30")
 Set r1 = Range(Range(r), Range(r).Offset(j, 1))
 MsgBox r1.Address
 End Sub
 
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
union of named ranges based only on the names of those ranges sloth Microsoft Excel Programming 3 2nd Oct 2006 03:18 AM
Sorting ranges of revenue and ranges of employees =?Utf-8?B?TGFycnk=?= Microsoft Access Getting Started 2 14th Sep 2006 06:43 PM
Copy data in named ranges to a newer version of the same template to identical ranges handstand Microsoft Excel Programming 0 21st Aug 2006 03:51 PM
Excel2000: Is it possible to use named ranges as chart's series ranges Arvi Laanemets Microsoft Excel Misc 8 11th Jul 2004 06:00 PM
named ranges - changing ranges with month selected gr8guy Microsoft Excel Programming 2 28th May 2004 04:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:18 PM.