|
-
February 13th, 2009, 05:23 AM
#1
Cannot copy from excel file
Hi i have a worksheet in excel with several tabs.In one of them i start a form that will copy a value from one of the cells.According to this value i have to automatically select some cells from another tab and manipulate them.The problem is that before adding the form,everithing worked just fine,but now after adding the form,the needed cells are selected but not copied anymore .I attached the code so that you will see what i mean:
UserForm1.Show 'show form
.................
................
ActiveSheet.Cells(2, "GX").Select
GX22 = ActiveCell.Value
GXvar = "GX" & count
ICvar = "IC" & count
Range(GXvar, ICvar).Select 'select one row to be copied
Selection.Copy
i = 4 + GX22 'jost some variable to determine where to paste
ActiveSheet.Cells(i, "GX").Select 'select cell where copied code will be inserted
ActiveSheet.Paste
The thing is that the selection is made but "Selection.copy" is not working and when i try to paste,it will just paste what was in the clipboard.
Can somebody help?
thanks
-
February 13th, 2009, 07:08 AM
#2
Re: Cannot copy from excel file
Have you tried recording a macro of the events by doing ti manually in Excel. Usually when you look at the recorded macro you can see what it is that you are doing wrong.
If you find my answers helpful, dont forget to rate me 
-
February 13th, 2009, 07:27 AM
#3
Re: Cannot copy from excel file
hi
yes,i tried with that and it records the same things
"selection.copy" and afterwards "ActiveSheet.Paste" but the thing is that it does not copy my selection and when trying to paste ,it will paste the last thing i copied in the clipboard.It has something to do with that form that i call.
does anyone have a clue?
-
February 13th, 2009, 03:14 PM
#4
Re: Cannot copy from excel file
I suspect you have something in your worksheet event (example"Private Sub Worksheet_Change(ByVal Target As Range))" that cancels your copy mode.
Do you have active events inside the worksheet object?
Marketing our skills - please participate in the survey and share your insights
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|