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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:50:06+00:00 2026-05-22T11:50:06+00:00

I have a excel file which contains 5 sheets in it. The 1st sheet

  • 0

I have a excel file which contains 5 sheets in it. The 1st sheet contains hyperlinks form A1 to A4 cells with some names pointing to the respective 4 sheets in the workbook.
I need to write vba function which should consist of a while loop, loop through each cell in sheet 1, then after reading 1st cell in sheet 1 it should go to the connected sheet copy all the data from it and put it in a different workbook and again go to next cell in sheet 1 copy the data and appened the data to the new workbook and repeat the process till it finds an empty cell.
Please provide me a sample as i am new to vba programming.
Thank you in advance

  • 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-22T11:50:07+00:00Added an answer on May 22, 2026 at 11:50 am

    For demonstrative purposes, since the OP had originally asked for a sample. This will take 4 cells defined in the first sheet of a workbook and collect selected cells’ data from the second and third sheets and paste it into the 4th.

    The first sheet:

         A
    1  Sheet2!C8    (these are all hyperlinks)
    2  Sheet2!G15 
    3  Sheet3!C10
    4  Sheet3!D13
    

    The macro code:

    Sub Test2()
        Dim cell As Range
        Dim sel As Range
        Dim index As Integer
        index = 1
        Set sel = Range(Cells(1, 1), Cells(1.1).End(xlDown))
        For Each cell In sel            
            cell.Hyperlinks(1).Follow 
            ActiveCell.Copy
            Sheets(4).Select
            Range("A" & index).PasteSpecial
            index = index + 1
        Next
    
    End Sub
    

    Obviously a lot of it hard-coded to this situation, and I’m sure there are more effective ways to do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an excel file which contains 400 sheets. How can I load this
Good Afternoon, I have a an Excel template file - which contains Macros -
I have an excel file which has more than 65536 rows. However, I can
I have an ASP.NET web application which does the following: Reads an Excel file.
I have written an Excel VBA macro which imports data from a HTML file
I have some content that i have to render as a excel file in
in excel i have a column which contains about 5 numbers cola num1 num2
I have an excel file which I've been supplied a layout for with the
I have an excel file with numerous Non-ASCII characters which I would like to
I have a program which makes changes to a relatively small Excel file, then

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.