ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem entering data in hidden cell, via macro (https://www.excelbanter.com/excel-programming/399949-problem-entering-data-hidden-cell-via-macro.html)

Dave

Problem entering data in hidden cell, via macro
 
I have used InputBox to enter data in a visible cell without a problem but it
doesn't work when the cell is in a hidden column. (See code below)

QtyCol = Range("Rpt_Qnty").Column
mnextrow = Cells(Rows.Count, StkCol).End(xlUp).Row + 1
ip = InputBox("Enter Quantity", "Quantity")
Cells(mnextrow, QtyCol).Value = ip

How can I use similar code to enter a value into a cell in a hidden column?
Thanks.


JE McGimpsey

Problem entering data in hidden cell, via macro
 
First, what exactly does "doesn't work" mean? Do you get a run-time
error? Is the wrong/no value assigned? Do you get a crash?

Are the cells or worksheet protected? Validation set?

Simply hiding the column shouldn't prevent entry.



In article ,
Dave wrote:

I have used InputBox to enter data in a visible cell without a problem but it
doesn't work when the cell is in a hidden column. (See code below)

QtyCol = Range("Rpt_Qnty").Column
mnextrow = Cells(Rows.Count, StkCol).End(xlUp).Row + 1
ip = InputBox("Enter Quantity", "Quantity")
Cells(mnextrow, QtyCol).Value = ip

How can I use similar code to enter a value into a cell in a hidden column?
Thanks.


Tom Ogilvy

Problem entering data in hidden cell, via macro
 
I don't see a problem with it. Are you sure you are using the right column
to get the last row value:

mnextrow = Cells(Rows.Count, StkCol).End(xlUp).Row + 1


does the value of StkCol check the right column.

concept tested in xl2003
--
Regards,
Tom Ogilvy





"Dave" wrote:

I have used InputBox to enter data in a visible cell without a problem but it
doesn't work when the cell is in a hidden column. (See code below)

QtyCol = Range("Rpt_Qnty").Column
mnextrow = Cells(Rows.Count, StkCol).End(xlUp).Row + 1
ip = InputBox("Enter Quantity", "Quantity")
Cells(mnextrow, QtyCol).Value = ip

How can I use similar code to enter a value into a cell in a hidden column?
Thanks.


Dave

Problem entering data in hidden cell, via macro
 
I needed to modify StkCol to get the right column.
Thanks very much.

"Tom Ogilvy" wrote:

I don't see a problem with it. Are you sure you are using the right column
to get the last row value:

mnextrow = Cells(Rows.Count, StkCol).End(xlUp).Row + 1


does the value of StkCol check the right column.

concept tested in xl2003
--
Regards,
Tom Ogilvy





"Dave" wrote:

I have used InputBox to enter data in a visible cell without a problem but it
doesn't work when the cell is in a hidden column. (See code below)

QtyCol = Range("Rpt_Qnty").Column
mnextrow = Cells(Rows.Count, StkCol).End(xlUp).Row + 1
ip = InputBox("Enter Quantity", "Quantity")
Cells(mnextrow, QtyCol).Value = ip

How can I use similar code to enter a value into a cell in a hidden column?
Thanks.



All times are GMT +1. The time now is 01:14 AM.

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