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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:07:00+00:00 2026-06-08T18:07:00+00:00

I currently have an array which I populate and paste in a sheet named

  • 0

I currently have an array which I populate and paste in a sheet named “T1” using a macro. My current macro uses the rowcount function to determine the used rows and pastes the array from the next available row.

The problem I am having is that when I paste this array multiple times, the arrays need to be spaced by a row so that i can differentiate different submissions. This is what I have so far, and I was hoping someone could help me with this:

Sub CopyData()

     Dim Truearray() As String
     Dim cell As Excel.Range
     Dim RowCount1 As Integer
     Dim i As Integer
     Dim ii As Integer
     Dim col As Range
     Dim col2 As Range
     i = 0
     ii = 2

     RowCount1 = DHRSheet.UsedRange.Rows.Count
     Set col = DHRSheet.Range("I1:I" & RowCount1)

     For Each cell In col

         If cell.Value = "True" Then

             Dim ValueCell As Range
             Set ValueCell = Cells(cell.Row, 3)
             ReDim Preserve Truearray(i)
             Truearray(i) = ValueCell.Value

             Dim siblingCell As Range
             Set siblingCell = Cells(cell.Row, 2)
             Dim Siblingarray() As String

             ReDim Preserve Siblingarray(i)
             Siblingarray(i) = DHRSheet.Name & "$" & siblingCell.Value

             i = i + 1

         End If

     Next

     Dim RowCount2 As Integer

     RowCount2 = DataSheet.UsedRange.Rows.Count + 1

     For ii = 2 To UBound(Truearray)
         DataSheet.Cells(RowCount2 + ii, 2).Value = Truearray(ii)
     Next

     For ii = 2 To UBound(Siblingarray)
         DataSheet.Cells(RowCount2 + ii, 1).Value = Siblingarray(ii)
     Next

     DataSheet.Columns("A:B").AutoFit

     MsgBox ("Data entered has been successfully validated & logged")

 End Sub 
  • 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-08T18:07:02+00:00Added an answer on June 8, 2026 at 6:07 pm

    If you Offset two rows from the bottom cell, you will leave a blank row of separation. You should also consider filling the whole array as base 1 and writing it to DataSheet in one shot.

    Sub CopyData2()
    
        Dim rCell As Range
        Dim aTrues() As Variant
        Dim rRng As Range
        Dim lCnt As Long
    
        'Define the range to search
        With DHRSheet
            Set rRng = .Range(.Cells(1, 9), .Cells(.Rows.Count, 9).End(xlUp))
        End With
    
        'resize array to hold all the 'trues'
        ReDim aTrues(1 To Application.WorksheetFunction.CountIf(rRng, "True"), 1 To 2)
    
        For Each rCell In rRng.Cells
            If rCell.Value = "True" Then
                lCnt = lCnt + 1
                'store the string from column 2
                aTrues(lCnt, 1) = DHRSheet.Name & "$" & rCell.Offset(0, -7).Value
                'store the value from column 3
                aTrues(lCnt, 2) = rCell.Offset(0, -6).Value
            End If
        Next rCell
    
        'offset 2 from the bottom row to leave a row of separation
        With DataSheet.Cells(DataSheet.Rows.Count, 1).End(xlUp).Offset(2, 0)
            'write the stored information at one time
            .Resize(UBound(aTrues, 1), UBound(aTrues, 2)).Value = aTrues
        End With
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an array full of data which from what I believe is
I currently have a statement which reads if(Arrays.asList(results).contains(Word)); and I want to add at
I have the following script currently, which gets the category IDs as arrays: $sql_select_categories
Currently I have: NSArray* array = [NSArray arrayWithObjects:@"auth.login",@"username",@"password", nil]; NSData* packed_array = [array messagePack];
I currently have the dynamic array: char *myData[500][10]; //myData is the name of an
Currently, I have an array of Strings, each with random characters in it that
I have an API call that returns a byte array. I currently stream the
I am currently trying to pass an array that I have created in Javascript
I have an array containing specific times and I want when the current time
In my Values folder for my project, I have a string array named currency_avatar.

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.