VBA Selection.Column

Lara465

New Member
Joined
Mar 29, 2020
Messages
32
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello!

So I have something like this :

Dim selrow as string, selcol as string

I do an action an then I am in a specific cell and I write
selcol=Selection.Column
To keep the column number I was in

A do some other actions and I end up in another cell, this time I want tot keep the row of this current cell
celrow=Selection.Column

This is where I blocked. So I have a number in each selcol and selrow, is there a way to put them together? To tell to go select the Cell[celrow, celcol], so to use the celrow and celcolumn as a range.
Ex: if celrow = 2 and celcol= 3, to go and select the cell (2,3) ?

Thanks.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I found the answear, If I declare then as Integer not String, I can call them by using Cells(celrow,celcol).Select.
 
Upvote 0
hi, Lara

Glad you sorted that out.

I suspect it is just a typing error, but just in case, where you've got "celrow = Selection.Column" should be "celrow = Selection.Row"

regards, Fazza
 
Upvote 0

Forum statistics

Threads
1,217,440
Messages
6,136,640
Members
450,022
Latest member
Joel1122331

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