Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Range.Value doesn't work in hidden columns

Can anybody help me with this - I've been all over Google trying to
figure it out.

The following code:

With rs
.AddNew ' create a new record
' add values to each field in the record
.Fields("dataWeekID") = Range("H" & r).Value
.Fields("Month") = Range("I" & r).Value
.Fields("SBU") = Range("J" & r).Value
.Fields("PC") = Range("K" & r).Value
.Fields("Rev") = CLng(Range("E" & r).Value)
.Fields("Mgn") = CLng(Range("F" & r).Value)
.Fields("Comments") = Range("G" & r).Value
' add more fields if necessary...
.Update ' stores the new record
End With

Works fine if the columns are visible. However, when I hide the
columns (H,I,J & K) and debug, the Value property comes up empty.
Anybody know a way around this?

Thanks!

Jeff

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Range.Value doesn't work in hidden columns

this demo from the immediate window shows there is no problem with using that
construct when the column is hidden

r = 10
Range("K" & r).Value = 100
Range("K:K").EntireColumn.Hidden = True
? Range("K" & r).Value
100



--
Regards,
Tom Ogilvy



" wrote:

Can anybody help me with this - I've been all over Google trying to
figure it out.

The following code:

With rs
.AddNew ' create a new record
' add values to each field in the record
.Fields("dataWeekID") = Range("H" & r).Value
.Fields("Month") = Range("I" & r).Value
.Fields("SBU") = Range("J" & r).Value
.Fields("PC") = Range("K" & r).Value
.Fields("Rev") = CLng(Range("E" & r).Value)
.Fields("Mgn") = CLng(Range("F" & r).Value)
.Fields("Comments") = Range("G" & r).Value
' add more fields if necessary...
.Update ' stores the new record
End With

Works fine if the columns are visible. However, when I hide the
columns (H,I,J & K) and debug, the Value property comes up empty.
Anybody know a way around this?

Thanks!

Jeff


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Range.Value doesn't work in hidden columns

Thanks Tom - you're right. I assumed something that wasn't the case.
I went back and found an unrelated error in my code.

cheers,

Jeff


Tom Ogilvy wrote:
this demo from the immediate window shows there is no problem with using that
construct when the column is hidden

r = 10
Range("K" & r).Value = 100
Range("K:K").EntireColumn.Hidden = True
? Range("K" & r).Value
100



--
Regards,
Tom Ogilvy



" wrote:

Can anybody help me with this - I've been all over Google trying to
figure it out.

The following code:

With rs
.AddNew ' create a new record
' add values to each field in the record
.Fields("dataWeekID") = Range("H" & r).Value
.Fields("Month") = Range("I" & r).Value
.Fields("SBU") = Range("J" & r).Value
.Fields("PC") = Range("K" & r).Value
.Fields("Rev") = CLng(Range("E" & r).Value)
.Fields("Mgn") = CLng(Range("F" & r).Value)
.Fields("Comments") = Range("G" & r).Value
' add more fields if necessary...
.Update ' stores the new record
End With

Works fine if the columns are visible. However, when I hide the
columns (H,I,J & K) and debug, the Value property comes up empty.
Anybody know a way around this?

Thanks!

Jeff



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Views + hidden columns does seem to work BLUV Excel Discussion (Misc queries) 0 December 4th 09 08:47 PM
Paste into range with hidden columns jday Excel Discussion (Misc queries) 0 September 18th 09 04:54 PM
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Hidden Columns No Longer Hidden after Copying Worksheet? EV Nelson Excel Discussion (Misc queries) 1 December 6th 06 05:10 PM
vlookup function does not work when range is hidden VLOOKUP FUNCTION Excel Discussion (Misc queries) 1 September 8th 06 07:46 PM


All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"