Speficy cell in VBA using column letter and a row number

tightwad

Well-known Member
Joined
Feb 22, 2006
Messages
609
How do I specify a cell in VBA using a column letter, and a row # stored as a value?


CR is my "current row" that I am working with. It has been declared as a value

Set box = .document.all.Item(ThisWorkbook.Sheets("tbas").Range("A & CR").Offset(1, 1).Value)

This didn't work, but I don't know how to do it....it has to be simple.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Just move CR outside the quotes.
Code:
Set box = .document.all.Item(ThisWorkbook.Sheets("tbas").Range("A" & CR).Offset(1, 1).Value)
 
Upvote 0
What value is being returned by this?
Code:
ThisWorkbook.Sheets("tbas").Range("A" & CR).Offset(1, 1).Value
Does an item with that name exist on the document?
 
Upvote 0
What value is being returned by this?
Code:
ThisWorkbook.Sheets("tbas").Range("A" & CR).Offset(1, 1).Value
Does an item with that name exist on the document?

The cell part was working, the problem was this Macro is designed to work with a form, but I was skipping the form part to test the cell address. I verified this by using my old process and getting the same error. Then I ran it throught he whole macro and it worked.

Didn't fix my problem with slowness, but it worked.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,208
Members
448,554
Latest member
Gleisner2

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