defining a range an find the range address value

rvkcools

Board Regular
Joined
Mar 14, 2013
Messages
78
Hi folks

In vba

can we define a range as value for example

range(selection,selection.end(xltoright))select
based on the above i would like to identify the range like range(a1:l1) and wen i add +1 is should be range(a1:l1+1) and
move to range(a1:m1).select

Please help me
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
try below
Code:
Range(Cells(1, 1), Cells(1, Columns.Count).End(xlToLeft)).Select
 
Upvote 0
try below
Code:
Range(Cells(1, 1), Cells(1, Columns.Count).End(xlToLeft)).Select
Thank you arvind for your great and continuous support.
thank you. the code work fine and its selecting the range of data

for example i have data from "a" to "m"
but my active cell cell should be of this code+1column extra every time that means it should be in "n"

Please hlep me.
 
Upvote 0
try below
Code:
Range(ActiveCell, Cells(ActiveCell.Row, 1)).Select
 
Upvote 0
try below
Code:
Range(ActiveCell, Cells(ActiveCell.Row, 1)).Select


Range(Cells(1, 1), Cells(1, Columns.Count).End(xlToLeft)).Select</pre>by using this code it is selecting the row "m" to "a" but i want to select my activecell as m+1 = "n"
 
Upvote 0
oopps now i got it what you need
try below
Code:
ActiveCell.Offset(0, 1).Select
 
Upvote 0
oopps now i got it what you need
try below
Code:
ActiveCell.Offset(0, 1).Select

wen i enter this code "

Range(Cells(1, 1), Cells(1, Columns.Count).End(xlToLeft)).Select" - it is selecting data of first row from "a" to "m" but wen i use ur code
activecell.offset(0,1).select it is selecting "b1" but i want to select "n"

please help me


</pre>
 
Upvote 0
sorry but i am not getting what u need can give some sample data or more example which is ur activecell and then what u want to do
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top