Forum

VBA SCRIPT TO OFFSE...
 
Notifications
Clear all

VBA SCRIPT TO OFFSET SELECTED RANGE

7 Posts
3 Users
0 Reactions
100 Views
(@mr-motha)
Posts: 7
Active Member
Topic starter
 

Hey Team,

Is there a way to OffSet a selection range of cells to a different location. I need a script that is dymanic for example:

Offset:

Selected Cells range A1:A5 to C1:C5 or B1:B10 to E1:E10 using the same script, which should be based on selected ranges.

 

Script being used to select range is as below:

'Range("A1").Select
'Range(Selection, Selection.End(xlDown)).Select

 

Rgds,

Themba.

 
Posted : 18/01/2019 8:47 am
(@debaser)
Posts: 836
Member Moderator
 

Those are different offsets - how should the code determine what offset you want?

 
Posted : 18/01/2019 9:53 am
(@mr-motha)
Posts: 7
Active Member
Topic starter
 

The script should be based on the selected cells.

 
Posted : 19/01/2019 3:40 am
(@debaser)
Posts: 836
Member Moderator
 

I mean how does it know how far to offset from the selection?

 
Posted : 20/01/2019 5:00 am
(@mr-motha)
Posts: 7
Active Member
Topic starter
 

I guess there is no way...thanks will find a work around

 
Posted : 21/01/2019 4:29 pm
(@debaser)
Posts: 836
Member Moderator
 

There are plenty of ways but you haven't explained what you want. Do you want a prompt to specify how many columns across to offset? Or should it actually be a fixed number in spite of your examples?

 
Posted : 23/01/2019 1:16 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Themba

as Velouria said, you haven’t explained what you are trying to do or why you are doing it. If we don’t understand the problem and the result you expect it’s difficult to provide help. 

Regards

Phil

 
Posted : 23/01/2019 10:48 pm
Share: