HomeLatest ThreadsGreatest ThreadsForums & GroupsMy SubscriptionsMy Posts
DU Home » Latest Threads » Forums & Groups » Topics » Computers & Internet » Apple Users (Group) » is there a way to create ...

Tue Apr 13, 2021, 01:21 AM

is there a way to create a range of cells using a calculated value

In excel macro

example Range(b1: b(val(c41)).select
I know this isn't correct but if you know what i am trying to do, maybe you could tell me the correct way.
C41 has a value after all data is entered. the data changes weekly.

1 replies, 1000 views

Reply to this thread

Back to top Alert abuse

Always highlight: 10 newest replies | Replies posted after I mark a forum
Replies to this discussion thread
Arrow 1 replies Author Time Post
Reply is there a way to create a range of cells using a calculated value (Original post)
tiredtoo Apr 2021 OP
Foolacious Apr 2021 #1

Response to tiredtoo (Original post)

Tue Apr 13, 2021, 02:09 AM

1. I would just set a variable to that value.

Something like this:


Dim nVal As Long
nVal = Range("C41:C41" ).Value
Range("B1:B" & nVal).Select


But if it's important to get it all into one line of code, you can do this, though it looks a bit opaque:


Range("B1:B" & Range("C41:C41" ).Value).Select

Reply to this post

Back to top Alert abuse Link here Permalink

Reply to this thread