How do I get Excel row number as variable?

  Simsy 11:19 02 Jun 03
Locked

Hi folks….
I’m trying to write a piece of code that will insert a formula into a cell. The basic process is that the cell is selected and a button is clicked. A string is created, (containing variables which vary according to the row number of the cell), and then this is inserted into the cell.

I have 2 problems so I’ll use 2 threads..

How do I extract the Rownumber from the active cell to make it a variable?
I have tried;


'The row number of the active cell
Dim RNum As String
RNum = ActiveCell.Row

and many variations with no success

Thanks in advance,

Regards,

Simsy

  Simsy 11:59 02 Jun 03

The site formatting didn't help with the display of my code....

what the above should have said was....

'The row number of the active cell

Dim RNum As String

RNum = ActiveCell.Row

In fact making RNum an Integer has solved that bit, but I need to find the column letter as well, which obviously isn't an integer. (I hadn't posted this part originally as I thought the solution would be the same for both row and column!)

Any more help is welcome.

Thanks in anticipation,

Regards,

Simsy

  Simsy 12:31 02 Jun 03

the column letter is an integer, where,

A = 1

B = 2

C = 3

etc.... so this problem is solved!

Regards,

Simsy

  Tenner 12:44 02 Jun 03

If all else fails, try click here and type in search <reference books> there are a couple on Excel at a reduced price - no experience of these books, but could be a start

Lidl sometimes have a cheap ref book on offer

Regards

  Simsy 16:57 02 Jun 03

I have several at home in fact.... there is no budget for any more spending on Excel books! I was posting the above from work.

Anyway, I appreciate the link!

Regards,

Simsy

  barrie_g 18:25 02 Jun 03

get "work" to buy some more books, put it down as on the job training and point out that the more your able to do the more productive you can be for your company.

This thread is now locked and can not be replied to.

What is Amazon Go and will it come to the UK? The store without checkouts or queues

1995-2015: How technology has changed the world in 20 years

Hands-on with the Star Wars fighting drones you can fly yourself

iPhone 9 and beyond: 32 amazing future smartphone developments - graphene, supercapacitor…