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 8014777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:02:49+00:00 2026-06-04T20:02:49+00:00

I already spent hours on this problem, but I didn’t succeed in finding a

  • 0

I already spent hours on this problem, but I didn’t succeed in finding a working solution.

Here is my problem description:

I want to loop through a certain range of cells in one workbook and copy values to another workbook. Depending on the current column in the first workbook, I copy the values into a different sheet in the second workbook.
When I execute my code, I always get the runtime error 439: object does not support this method or property.

My code looks more or less like this:

Sub trial()

Dim Group As Range
Dim Mat As Range
Dim CurCell_1 As Range
Dim CurCell_2 As Range

Application.ScreenUpdating = False

Set CurCell_1 = Range("B3") 'starting point in wb 1

For Each Group in Workbooks("My_WB_1").Worksheets("My_Sheet").Range("B4:P4")
    Set CurCell_2 = Range("B4") 'starting point in wb 2
    For Each Mat in Workbooks("My_WB_1").Worksheets("My_Sheet").Range("A5:A29")
        Set CurCell_1 = Cells(Mat.Row, Group.Column) 'Set current cell in the loop
        If Not IsEmpty(CurCell_1)
            Workbooks("My_WB_2").Worksheets(CStr(Group.Value)).CurCell_2.Value = Workbooks("My_WB_1").Worksheets("My_Sheet").CurCell_1.Value 'Here it break with runtime error '438 object does not support this method or property
            CurCell_2 = CurCell_2.Offset(1,0) 'Move one cell down
        End If
    Next
Next

Application.ScreenUpdating = True

End Sub

I’ve done extensive research and I know how to copy values from one workbook to another if you’re using explicit names for your objects (sheets & ranges), but I don’t know why it does not work like I implemented it using variables.
I also searched on stackoverlow and -obviously- Google, but I didn’t find a similar problem which would answer my question.

So my question is:
Could you tell me where the error in my code is or if there is another easier way to accomplish the same using a different way?

This is my first question here, so I hope everything is fine with the format of my code, the question asked and the information provided. Otherwise let me know.

  • 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-06-04T20:02:51+00:00Added an answer on June 4, 2026 at 8:02 pm

    5 Things…

    1) You don’t need this line

    Set CurCell_1 = Range("B3") 'starting point in wb 1

    This line is pointless as you are setting it inside the loop

    2) You are setting this in a loop every time

    Set CurCell_2 = Range("B4")

    Why would you be doing that? It will simply overwrite the values every time. Also which sheet is this range in??? (See Point 5)

    3)CurCell_2 is a Range and as JohnB pointed it out, it is not a method.

    Change

    Workbooks("My_WB_2").Worksheets(CStr(Group.Value)).CurCell_2.Value = Workbooks("My_WB_1").Worksheets("My_Sheet").CurCell_1.Value

    to

    CurCell_2.Value = CurCell_1.Value

    4) You cannot assign range by just setting an "=" sign

    CurCell_2 = CurCell_2.Offset(1,0)

    Change it to

    Set CurCell_2 = CurCell_2.Offset(1,0)

    5) Always specify full declarations when working with two or more objects so that there is less confusion. Your code can also be written as

    Option Explicit
    
    Sub trial()
        Dim wb1 As Workbook, wb2 As Workbook
        Dim ws1 As Worksheet, ws2 As Worksheet
        Dim Group As Range, Mat As Range
        Dim CurCell_1 As Range, CurCell_2 As Range
    
        Application.ScreenUpdating = False
        
        '~~> Change as applicable
        Set wb1 = Workbooks("My_WB_1")
        Set wb2 = Workbooks("My_WB_2")
        
        Set ws1 = wb1.Sheets("My_Sheet")
        Set ws2 = wb2.Sheets("Sheet2") '<~~ Change as required
    
        For Each Group In ws1.Range("B4:P4")
            '~~> Why this?
            Set CurCell_2 = ws2.Range("B4")
            For Each Mat In ws1.Range("A5:A29")
                Set CurCell_1 = ws1.Cells(Mat.Row, Group.Column)
                If Not IsEmpty(CurCell_1) Then
                    CurCell_2.Value = CurCell_1.Value
                    Set CurCell_2 = CurCell_2.Offset(1)
                End If
            Next
        Next
    
        Application.ScreenUpdating = True
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with php header redirect. I already spent hours trying to
I've already spent countless hours puzzling over this, utilizing Google searches and other Stack
I know there are many similar questions already, but I've spent hours trying to
I know that this question was asked millions of times, but i already spent
I have spent 5 hours on this, and I've already been up 30 hours
I was sure there was an answer to this question already but I've spent
Already 2 hours I spent on Google to find this content slider. No luck.
First, forgive me if this has been answered already. I spent a few hours
Spent hours but couldn't find what is the problem with the code. The code
First, I have already spent the past few hours trying to find a solution

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.