ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   type mismatch error (https://www.excelbanter.com/excel-programming/431733-type-mismatch-error.html)

Sam

type mismatch error
 
Hi All, I am trying to update two sheets in different workbooks with the same
user input accepted through userform and I am getting a type mismatch error.
Here is where I am getting the error:

If Male.Value = True Then
ws.Cells(iRow, 2).Value = "Yes" And wst.Cells(2, 2).Value = "Yes"
End If

ws and wst are two seperate sheets in two seperate workbooks.

Thanks in Advance

John

type mismatch error
 
hi Sam,
try it this way:

If Male.Value = True Then
ws.Cells(iRow, 2).Value = "Yes"
wst.Cells(2, 2).Value = "Yes"
End If
--
jb


"sam" wrote:

Hi All, I am trying to update two sheets in different workbooks with the same
user input accepted through userform and I am getting a type mismatch error.
Here is where I am getting the error:

If Male.Value = True Then
ws.Cells(iRow, 2).Value = "Yes" And wst.Cells(2, 2).Value = "Yes"
End If

ws and wst are two seperate sheets in two seperate workbooks.

Thanks in Advance


Sam

type mismatch error
 
that works great! Thank you

"john" wrote:

hi Sam,
try it this way:

If Male.Value = True Then
ws.Cells(iRow, 2).Value = "Yes"
wst.Cells(2, 2).Value = "Yes"
End If
--
jb


"sam" wrote:

Hi All, I am trying to update two sheets in different workbooks with the same
user input accepted through userform and I am getting a type mismatch error.
Here is where I am getting the error:

If Male.Value = True Then
ws.Cells(iRow, 2).Value = "Yes" And wst.Cells(2, 2).Value = "Yes"
End If

ws and wst are two seperate sheets in two seperate workbooks.

Thanks in Advance



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

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