Help

  • Thread starter Thread starter Ven
  • Start date Start date
V

Ven

Hi,

Is there a way that using vba, i would like to copy the
particular cell range from worksheet1 and paste into the
new workbook? Also, how to ensure that the particular
cell range that i copy will contains text instead of
empty cell?

many thanks.

regards,
Ven
 
Ven,

like this?

Sub Copyc3d4()
if not isempty(Worksheets("Sheet1").Range("c3")) then
Worksheets("Sheet1").Range("c3").copy _
Destination:=Activeworkbook.Worksheets("Sheet2").Range("d4")
else
Beep
endif
end with
End sub

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Ven wrote :
 
Hi,

thanks a million. Is there a way to actually copy to a new
excel file? Also, as the original excel file(data that i
copy from ) consists of other worksheets and how can VBA
be coded in such a way that will append to new row on the
new excel file after copy data from sheet1 and follow by
copy data from sheet2?

many thanks.

regards,
Ven
 
this goes on a cell by cell basis..
which I doubt is what you really want.. :(

But since you dont specify which cells need to be copied
i can do no more... thus I fear that you come back for more..

Please next time : define your problem more exact THEN ask for answer.
Also buy a book. These thing may be complicated for you now, but if you
study the fundamentals of VBA for a week or so.. you can also
understand it and even do it yourself...


Sub CopyToNew()
Dim wbSrc As Workbook
Dim wsSrc As Worksheet
Dim wsTgt As Worksheet

Set wbSrc = ActiveWorkbook
Set wsTgt = Workbooks.Add(xlWBATWorksheet).Worksheets(1)

For Each wsSrc In wbSrc.Worksheets
With wsSrc.Range("A3")
If Not IsEmpty(.Value) Then
.Copy wsTgt.Cells(Rows.Count, 1).End(xlUp)
End If
End With
Next

End Sub




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Ven wrote :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top