ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help (https://www.excelbanter.com/excel-programming/304814-help.html)

Ven[_2_]

Help
 
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

keepITcool

Help
 
Ven,

like this?

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

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


Ven wrote :

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[_2_]

Help
 
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
-----Original Message-----
Ven,

like this?

Sub Copyc3d4()
if not isempty(Worksheets("Sheet1").Range("c3")) then
Worksheets("Sheet1").Range("c3").copy _
Destination:=Activeworkbook.Worksheets("Sheet2").R ange

("d4")
else
Beep
endif
end with
End sub

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


Ven wrote :

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


.


keepITcool

Help
 



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 :

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




All times are GMT +1. The time now is 01:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com