Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6604347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:08:35+00:00 2026-05-25T19:08:35+00:00

I need help converting a range to a usable string. I’m not 100% sure

  • 0

I need help converting a range to a usable string. I’m not 100% sure of what I need, because I have little VBA or VB.NET experience, but ultimately i want to take a bunch of cells like B32 to J52 and perform linest function on C–J (as y values) and B (as x value).

I think if I can learn to pop out a string that says "Bxx:Jyy" Then i’d be able to tell it do linest(Cxx:Cyy, Bxx:Byy, true, false).

Is there an easier way to do this? Anyway, all I have right now is some code to get the range from the user (just got it from Google). If someone could just help me get the string like stated above, I think I can manage the rest.

Dim oRangeSelected As Range
Set oRangeSelected = Application.InputBox("Please select a range of cells!", _
                     "SelectARAnge Demo", Selection.Address, , , , , 8)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:08:35+00:00Added an answer on May 25, 2026 at 7:08 pm

    In this case you want the user selected range (not pre-existing selection), so

    MsgBox oRangeSelected.Address
    

    [Update]
    Actually, reading your question more closely, you can use ranges as is with LINEST, ie this sub gets a user range for X and Y and then feeds LINEST. The results are stored in an array, MyArr, which can be returned to the user.

    Sub Sample()
        Dim oRangeSelected1 As Range
        Dim oRangeSelected2 As Range
        Dim myArr()
        Set oRangeSelected1 = Application.InputBox("Please select a X range of cells!", "Select X Demo", Selection.Address, Type:=8)
        Set oRangeSelected2 = Application.InputBox("Please select a  Y range of cells!", "Select Y Demo", , Type:=8)
        If oRangeSelected1.Columns.Count + oRangeSelected2.Columns.Count > 2 Then
            MsgBox "Please select a single column range only"
            Exit Sub
        End If
        If oRangeSelected1.Cells.Count <> oRangeSelected2.Cells.Count Then
            MsgBox "Ranges are of different length"
            Exit Sub
        End If
        myArr = Application.WorksheetFunction.LinEst(oRangeSelected1, oRangeSelected2)
        MsgBox "slope is " & Format(myArr(1), "0.00") & " & intercept is " & Format(myArr(2), "0.00")
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help converting this string --> 20090727 10:16:36:643 to --> 07/27/2009 10:16:36 The
I need help converting this into PHP: Public Function Encrypt(ByVal text As String) As
I need help converting a VB.NET handles statement to C#. This is the VB
I need help to replace all \n (new line) caracters for in a String,
i need help with disk_total_space function.. i have this on my code <?php $sql=select
I have a regex call that I need help with. I haven't posted my
I need help converting the following code snippet to use SPSiteDataQuery instead of SPQuery
I need help converting eregi_replace to preg_replace (since in PHP5 it's depreciated): function makeClickableLinks($text)
I need help on this following aspx code aspx Code: <asp:Label ID =lblName runat
I need help understanding some C++ operator overload statements. The class is declared like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.