• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help in upload data from sheet to sheet VBA Code

Hi All,

i have done a VBA code for bulk upload and its is working fine.

But i need only help req this, data should upload in "data sheet" if all only all columns are to filled other wise it should have pop msg box pls help on this i have uploaded file for your reference and code in below.

>>> as many times noted <<<
>>> use code - tags <<<

Code:
Option Explicit

Sub copy_paste()

Dim lRow, lRow1 As Long

Application.ScreenUpdating = False


lRow = [Sheet2].Cells(Rows.Count, 1).End(xlUp).Row
lRow1 = [Sheet3].Cells(Rows.Count, 1).End(xlUp).Row + 1

    [Sheet2].Range("A4:M" & lRow).Copy
    [Sheet3].Range("A" & lRow1).PasteSpecial xlPasteValues
   
    Application.CutCopyMode = False
   
    Sheet3.Select
    [Sheet3].Range("A1").Select
    Sheet2.Select
    [Sheet2].Range("A1").Select
       
End Sub
 

Attachments

  • Price.xlsb
    36 KB · Views: 5
Last edited by a moderator:
jawaharprm
What would You mean if all only all columns are to filled?
At least one row has filled with headers.
What should copy and paste with Your sample file?
jawaharprm
Seems You skipped my the last question,
maybe someone else will guess.
 
Last edited:
Hi,​
as a reminder : with smart worksheets - aka with exactly same headers - that just needs around five codelines​
just using an easy Excel basics advanced filter …​
 
A VBA demonstration for starters :​
Code:
Sub Demo1()
    With Sheet2.[A3].CurrentRegion.Rows
        If Application.CountBlank(.Cells) Then Beep Else .Item("2:" & .Count).Copy Sheet3.Cells(Rows.Count, 1).End(xlUp)(2)
    End With
End Sub
Do you like it ? So thanks to click on bottom right Like !​
 
Back
Top