Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-Time Error
Hi,
I'm working on a programa and am trying to move some data from one sheet in a workbook to another. I wanted to move the data in seven cells from sheet 1 to sheet 2 Tried doing it with one cell This is my what my instructions look like: Sub MySub() Worksheets(Sheet2).Cells(2, 1) = Worksheets(Sheet1).Cells(2, 1) End Sub When I run it I get a Run-time Error 13 Type Mismatch error Can anyone tell me what that means and what I can to do correct the error? The cell format is "General." I have nothing else in the program. Just those lines. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-Time Error
Hi JimFor,
If you intend to use the sheet code names, try: Sheet2.Cells(2, 1),Value = Sheet1.Cells(2, 1).Value If you intend to use the sheet names, try: Worksheets("Sheet2").Cells(2, 1).Value = _ Worksheets("Sheet1").Cells(2, 1).Value --- Regards, Norman "JimFor" wrote in message ... Hi, I'm working on a programa and am trying to move some data from one sheet in a workbook to another. I wanted to move the data in seven cells from sheet 1 to sheet 2 Tried doing it with one cell This is my what my instructions look like: Sub MySub() Worksheets(Sheet2).Cells(2, 1) = Worksheets(Sheet1).Cells(2, 1) End Sub When I run it I get a Run-time Error 13 Type Mismatch error Can anyone tell me what that means and what I can to do correct the error? The cell format is "General." I have nothing else in the program. Just those lines. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-Time Error
Typo warning:
Sheet2.Cells(2, 1),Value = Sheet1.Cells(2, 1).Value should be: Sheet2.Cells(2, 1).Value = Sheet1.Cells(2, 1).Value (the comma preceding the first instance of Value should be a period) --- Regards, Norman "Norman Jones" wrote in message ... Hi JimFor, If you intend to use the sheet code names, try: Sheet2.Cells(2, 1),Value = Sheet1.Cells(2, 1).Value If you intend to use the sheet names, try: Worksheets("Sheet2").Cells(2, 1).Value = _ Worksheets("Sheet1").Cells(2, 1).Value |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-Time Error
Thanks. I'll try it.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming | |||
Run-time error '11' & Run-time error '1004' | Excel Programming |