Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Positioning a sheet

I have a spreadsheet to which I add a column of data every day.
I have set my columns on the spreadsheet so that all of them are about 1.5
inches in width.
This creates 8 columns that show on my screen at any one time.

I would like a macro that will always position the sheet from left to right
so that the last column on the right is a blank column and the other 7
columns to the
left of the blank column will have prior data in them showing as well.

Any suggestions would be much appreciated.

Roger


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Positioning a sheet

Roger,
Looking at the ActiveWindow's VisibleRange and ScrollColumn properties
would be a good place to start.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Roger Bedford"
wrote in message
I have a spreadsheet to which I add a column of data every day.
I have set my columns on the spreadsheet so that all of them are about 1.5
inches in width.
This creates 8 columns that show on my screen at any one time.

I would like a macro that will always position the sheet from left to right
so that the last column on the right is a blank column and the other 7
columns to the
left of the blank column will have prior data in them showing as well.
Any suggestions would be much appreciated.
Roger


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 145
Default Positioning a sheet

When open workbook,
the last column with data is cells(1, columns.count).end(xltoleft).column
then application.goto cells(1, lastcolumn-7) true

is what you want please.

"Roger Bedford" wrote in message
...
I have a spreadsheet to which I add a column of data every day.
I have set my columns on the spreadsheet so that all of them are about 1.5
inches in width.
This creates 8 columns that show on my screen at any one time.

I would like a macro that will always position the sheet from left to

right
so that the last column on the right is a blank column and the other 7
columns to the
left of the blank column will have prior data in them showing as well.

Any suggestions would be much appreciated.

Roger




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Positioning a sheet

Thanks Jim and PY for your suggestions.
Unfortunately Jim I am not familiar with ActiveWindow's VisibleRange and
ScrollColumn properties
and PY you can see below how far I got.

'Selects sheet and positions cursor
Sheets("Data").Select
Range("AP11").Select
Selection.End(xlToLeft).Select
'the above macros work

'I tried this but it didn't work
'ActiveCell.Offset(0, -6).Range("A1").Select 'Goes left 6

'I couldn't get the following to work
'Cells(1, Columns.Count).End(xlToLeft).Column
'application.goto cells(1, lastcolumn-7)true

If either of you could add another suggestion I would
really appreciate it.

Thanks,

Roger



"PY & Associates" wrote in message
...
When open workbook,
the last column with data is cells(1, columns.count).end(xltoleft).column
then application.goto cells(1, lastcolumn-7) true

is what you want please.

"Roger Bedford" wrote in message
...
I have a spreadsheet to which I add a column of data every day.
I have set my columns on the spreadsheet so that all of them are about
1.5
inches in width.
This creates 8 columns that show on my screen at any one time.

I would like a macro that will always position the sheet from left to

right
so that the last column on the right is a blank column and the other 7
columns to the
left of the blank column will have prior data in them showing as well.

Any suggestions would be much appreciated.

Roger






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Positioning a sheet


Roger,
You can run into problems with the following code if you don't have
the initial 8 columns in row 11 filled with data.
Also, try typing "ScrollColumn" in your module and with the cursor
still inside the word, press the F1 key.
(however,i used PY's idea)...
'---------------------
Sub MoveEmOut()
Dim rngCell As Excel.Range
Set rngCell = Sheets("Data").Cells(11, Columns.Count).End(xlToLeft).Offset(0, -6)
Application.Goto rngCell, True
Set rngCell = Nothing
End Sub
----------
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html



"Roger Bedford"
wrote in message
Thanks Jim and PY for your suggestions.
Unfortunately Jim I am not familiar with ActiveWindow's VisibleRange and
ScrollColumn properties
and PY you can see below how far I got.

'Selects sheet and positions cursor
Sheets("Data").Select
Range("AP11").Select
Selection.End(xlToLeft).Select
'the above macros work

'I tried this but it didn't work
'ActiveCell.Offset(0, -6).Range("A1").Select 'Goes left 6

'I couldn't get the following to work
'Cells(1, Columns.Count).End(xlToLeft).Column
'application.goto cells(1, lastcolumn-7)true

If either of you could add another suggestion I would
really appreciate it.
Thanks,
Roger



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
Hyperlink in same sheet - positioning problem neil40 Links and Linking in Excel 1 November 27th 09 09:52 PM
Positioning on a sheet Roger B. Excel Programming 3 December 20th 05 07:09 PM
Positioning a char in a sheet Rui Álvares Excel Programming 2 July 19th 05 04:11 AM
wrong positioning of data in sheet after clearcontents() Rea Excel Programming 1 June 21st 05 12:22 PM
Recalculate sheet & Positioning text boxes George Andrews Excel Programming 1 May 17th 05 10:56 PM


All times are GMT +1. The time now is 10:09 PM.

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

About Us

"It's about Microsoft Excel"