Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need coding help.


Hello,

Jim was good enough to put me on the right track, but I'm still
confused a bit (OK, a lot).

Here is the code and the explantion within it,

Sub DownloadFormatCopyTAB()
'
' DownloadFormatCopyTAB Macro
' Macro recorded 17/06/05 by IBM
'
' Downloads TAB data from web, formats and copies to
' TodaysRaces sheet at selected cell. Only cols D and E from
' the downloaded data are used.
'
ActiveSheet.PasteSpecial Format:="Text", Link:=False,
DisplayAsIcon:= _
False
'Note the range downloaded contains data in cols D to Q.
'only cols D and E are required.

Range("F8", Range("F8").End(xlDown)).Cut Range("E8")
Selection.Copy

' How do I select only D8:Exx to copy across???

Sheets("TodaysRaces").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
.................................................. ....

The above works, but copies the whole lot across, instead of the
required
range D8:Exx. The downloaded data has variable items.

Thanks
Neddy


--
Neddy
------------------------------------------------------------------------
Neddy's Profile: http://www.excelforum.com/member.php...o&userid=24345
View this thread: http://www.excelforum.com/showthread...hreadid=379937

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Need coding help.

Try something similar to:

LastRow = Range("F8").End(xlDown).Row

Range("D8:E" & LastRow).copy

"Neddy" wrote:


Hello,

Jim was good enough to put me on the right track, but I'm still
confused a bit (OK, a lot).

Here is the code and the explantion within it,

Sub DownloadFormatCopyTAB()
'
' DownloadFormatCopyTAB Macro
' Macro recorded 17/06/05 by IBM
'
' Downloads TAB data from web, formats and copies to
' TodaysRaces sheet at selected cell. Only cols D and E from
' the downloaded data are used.
'
ActiveSheet.PasteSpecial Format:="Text", Link:=False,
DisplayAsIcon:= _
False
'Note the range downloaded contains data in cols D to Q.
'only cols D and E are required.

Range("F8", Range("F8").End(xlDown)).Cut Range("E8")
Selection.Copy

' How do I select only D8:Exx to copy across???

Sheets("TodaysRaces").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
.................................................. ....

The above works, but copies the whole lot across, instead of the
required
range D8:Exx. The downloaded data has variable items.

Thanks
Neddy


--
Neddy
------------------------------------------------------------------------
Neddy's Profile: http://www.excelforum.com/member.php...o&userid=24345
View this thread: http://www.excelforum.com/showthread...hreadid=379937


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need coding help.


Sorry, that doesn't work. It selects D8:E to the end of the sheet. It
doesn't select only cells with data.

Thanks
Dave


--
Neddy
------------------------------------------------------------------------
Neddy's Profile: http://www.excelforum.com/member.php...o&userid=24345
View this thread: http://www.excelforum.com/showthread...hreadid=379937

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need coding help.


Try

Range("D8:E" & Range("D8").End(xlDown).Row).copy

probably it was a typo, Damon must have meant E8 and not F8. But You
may either try D8 or E8 as per your case.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=379937

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need coding help.


Mangesh,

Thanks very much, that works a treat.

much obliged,

Nedy


--
Neddy
------------------------------------------------------------------------
Neddy's Profile: http://www.excelforum.com/member.php...o&userid=24345
View this thread: http://www.excelforum.com/showthread...hreadid=379937



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need coding help.


Thanks for the feedback.

Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=37993

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Need coding help.

Do you have any data in column F when this code runs? Your goal is to use a
column that has data down to your desired row. You were using column F in
your code. Try another column.

If there are any blanks in your data, the "end down" process will give you
incorrect results. It is generally better to use "end up". Something similar
to:

LastRow = Range("D65536").End(xlup).row

"Neddy" wrote:


Sorry, that doesn't work. It selects D8:E to the end of the sheet. It
doesn't select only cells with data.

Thanks
Dave


--
Neddy
------------------------------------------------------------------------
Neddy's Profile: http://www.excelforum.com/member.php...o&userid=24345
View this thread: http://www.excelforum.com/showthread...hreadid=379937


Subject: Need coding help. 6/16/2005 7:04 PM PST

By: Damon Longworth In: microsoft.public.excel.programming


Try something similar to:

LastRow = Range("F8").End(xlDown).Row

Range("D8:E" & LastRow).copy

"Neddy" wrote:


Hello,

Jim was good enough to put me on the right track, but I'm still
confused a bit (OK, a lot).

Here is the code and the explantion within it,

Sub DownloadFormatCopyTAB()
'
' DownloadFormatCopyTAB Macro
' Macro recorded 17/06/05 by IBM
'
' Downloads TAB data from web, formats and copies to
' TodaysRaces sheet at selected cell. Only cols D and E from
' the downloaded data are used.
'
ActiveSheet.PasteSpecial Format:="Text", Link:=False,
DisplayAsIcon:= _
False
'Note the range downloaded contains data in cols D to Q.
'only cols D and E are required.

Range("F8", Range("F8").End(xlDown)).Cut Range("E8")
Selection.Copy

' How do I select only D8:Exx to copy across???

Sheets("TodaysRaces").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
.................................................. ....

The above works, but copies the whole lot across, instead of the
required
range D8:Exx. The downloaded data has variable items.

Thanks
Neddy


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
sum by coding without 0 kaja New Users to Excel 1 March 2nd 08 09:09 PM
sum by coding without 0 kaja New Users to Excel 2 March 1st 08 03:52 PM
"=ROW()-1" type of coding doesn't appear in a filter / is there coding that does? StargateFan[_3_] Excel Programming 10 October 6th 05 01:18 PM
VBA Coding (?) Larry G. Excel Programming 1 May 18th 05 05:48 PM
Coding help fpd833 Excel Programming 2 November 12th 04 08:22 PM


All times are GMT +1. The time now is 11:07 AM.

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"