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

  • SEARCH
  • Home
  • 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 6629623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:17:13+00:00 2026-05-25T22:17:13+00:00

UserForm1.TextBox1.Value = G4 Set CodeRange = Range(UserForm1.TextBox1.Value, Cells(Rows.Count, G).End(xlUp)) Gives: methog range of object

  • 0
UserForm1.TextBox1.Value = "G4"

Set CodeRange = Range(UserForm1.TextBox1.Value, Cells(Rows.Count, "G").End(xlUp))

Gives: methog range of object _global failed

Pls some help how to convert value from form to range.

  • 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-25T22:17:14+00:00Added an answer on May 25, 2026 at 10:17 pm

    Your code looks okay to me, although slightly unorthodox. Have you dimensioned CodeRange as a range?

    If the activehseet is a chart sheet you will get that error.

    You should also fully qualify your reference with the worksheet or activesheet.

    With WorkSheeets("Sheet1")
        Set CodeRange = .Range(UserForm1.TextBox1.Value, .Cells(Rows.Count, "G").End(xlUp))
    End With
    

    If your code is residing in the Userform module then you can use the Me keyword instead of Userfrom1.

    I prefer to get ranges from the user using a input box like this:

    Sub HTH()
    
        Dim rRange As Range
    
        On Error Resume Next
        rRange = Application.InputBox(Prompt:= _
                "Please select a range with your Mouse to be bolded.", _
                Title:="SPECIFY RANGE", Type:=8)
        On Error GoTo 0
    
        If Not rRange Is Nothing Then
            '// Your code here
        End If
    
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If UserForm1.ComboBox1.Value = One Then If UserForm1.ComboBox2.Value = Attentive Then For Each listItem In
As a secondary method to my question here: Show Cell Range on UserForm; then
I have a Form UserForm1 having two command buttons command 1 and command 2.
In excel vba I have added a commandbutton to userform... like below Set ctrl
In my controller: @Controller public class UserController { @RequestMapping(value=/admin/user/id/{id}/update, method=RequestMethod.GET) public ModelAndView updateUserHandler(@ModelAttribute(userForm) UserForm
Lets say I have a custom collection and a custom object that have a
I've been using a crude method to help the user update some cells -
I have a UserForm with ShowModal set True. I want to use the dialog
I have written sub main () 'some code goes here end sub This is
I currently have a ModelForm set up in Django, but would like to make

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.