Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help in copying and pasting data in excel using vbscript

Status
Not open for further replies.

naikadit

Technical User
Jun 30, 2008
22
US
Hi guys,

I am a newbie in vbscript and I need your help I am basically trying to copy all the data from one excel sheet into the same excel sheet (in the same location) but I want to paste it as value (pastespecial- value) as I want to remove all the formulas in the excel sheet and cel value should only be value not the formula

This is what I have done till now

Set objSheet = objExcel.ActiveWorkbook.Worksheets(4)


objsheet.Range("A1:T10000").Select
Selection.Copy.All
ActiveSheet.Paste.Value

its giving me an error that

Select method of range class failed

Also I want to make sure that there are no decimal numbers in the sheet but i donno how to achieve it

I need your help... please
 
Have you tried this ?
objExcel.ActiveWorkbook.Worksheets(4).Range("A1:T10000").Value = objExcel.ActiveWorkbook.Worksheets(4).Range("A1:T10000").Value

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PH it worked Thanks a lot .. Also can you please let me know how can I achieve that decimal thing .. I want to make sure that there are no decimal places in the worksheet but I dont know how to achieve it..

Once again thanks a lot for your reply I really appreciate it...
 
Hi PHV,

Thanks a ton for all your help.. what I wanna do now is that the script to show the cells which has decimal numbers.

Thanks a lot for all your help once again..

ADi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top