can you advise on code path please

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,737
Office Version
  1. 2007
Platform
  1. Windows
Hi,
Could you advise the code for the following please,i will then continue from there with the others i need to do.

I will add this to a button to transfer cell vales to my end of month sheet.

Worksheet called INCOME1
Copy cell value E32 & paste to Worksheet path shown below,

C,USERS,IAN,DESKTOP,EBAY,ACCOUNTS,PREVIOUS ACCOUNTS,2018 - 2019,SUMMARY 2018 - 2019,SHEET1, then cell E49

Thanks
 
Same run time error message.

So i made this as simple as it ca possibly be to try and get it to work.
Two workbooks.

One called WB1
Only one worksheet inside called C

Other workbook called WB2
Only one worksheet inside called P

WB1 has a button with this code shown below.


Code:
Private Sub CommandButton1_Click()Workbooks("WB1.xls").Sheets(C).Range("A1").Copy _
    Destination:=Workbooks("WB2").Sheets(P).Range("A1")
End Sub

Yet i still get run time error 9 message.
Subscript out of range.

I cant see how or why this is so hard.
There must be something else which isnt allowing this to work.
These two workbooks WB1 & WB2 were both open but still i get run time error 9 message.


Try

Private Sub CommandButton1_Click()
Workbooks("WB1").Sheets("C").Range("A1").Copy _
Destination:=Workbooks("WB2").Sheets("P").Range("A1")
End Sub

No need to mention the .xls and need to include the "" with the sheet names.
HTH!
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Wow,

Now that worked thanks.

I will play a while then come back.

Have a nice day
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top