Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sum by coding without 0 | New Users to Excel | |||
sum by coding without 0 | New Users to Excel | |||
"=ROW()-1" type of coding doesn't appear in a filter / is there coding that does? | Excel Programming | |||
VBA Coding (?) | Excel Programming | |||
Coding help | Excel Programming |