Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select case and Last Cell Problem


Hi

I am fairly new to VBA so be gentle. I have been working on the
attached code but am struggling with the CASE SELECT and the loop.

I am trying to search column B of Line List worksheet and if it
contains a letter ie is not blank copying it to another worksheet Tags
CSV.

I am also trying to loop this process until the end of my data but as
my data has gaps between it i need to go to the bottom or (1500 row in
column b of line list) move up one until a non blank row is found then
return a rown number as a value in order to stop my loop when it gets
there.

God I hope this makes sense to you lot as its sending me in circles.

I look forward to your response


+-------------------------------------------------------------------+
|Filename: Excel Help.doc |
|Download: http://www.excelforum.com/attachment.php?postid=4849 |
+-------------------------------------------------------------------+

--
JamesBurrows
------------------------------------------------------------------------
JamesBurrows's Profile: http://www.excelforum.com/member.php...o&userid=35101
View this thread: http://www.excelforum.com/showthread...hreadid=548559

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Select case and Last Cell Problem

Hi James

God I hope this makes sense

I try<g

Assume you not have formulas in the column
This will copy every row with data in column A to Sheets("Sheet2").Range("A1")


Sub test()
On Error Resume Next
Columns("A").SpecialCells(xlCellTypeConstants).Ent ireRow.Copy Sheets("Sheet2").Range("A1")
On Error GoTo 0
End Sub



--
Regards Ron De Bruin
http://www.rondebruin.nl



"JamesBurrows" wrote in message
news:JamesBurrows.28xlga_1149514504.7491@excelforu m-nospam.com...

Hi

I am fairly new to VBA so be gentle. I have been working on the
attached code but am struggling with the CASE SELECT and the loop.

I am trying to search column B of Line List worksheet and if it
contains a letter ie is not blank copying it to another worksheet Tags
CSV.

I am also trying to loop this process until the end of my data but as
my data has gaps between it i need to go to the bottom or (1500 row in
column b of line list) move up one until a non blank row is found then
return a rown number as a value in order to stop my loop when it gets
there.

God I hope this makes sense to you lot as its sending me in circles.

I look forward to your response


+-------------------------------------------------------------------+
|Filename: Excel Help.doc |
|Download: http://www.excelforum.com/attachment.php?postid=4849 |
+-------------------------------------------------------------------+

--
JamesBurrows
------------------------------------------------------------------------
JamesBurrows's Profile: http://www.excelforum.com/member.php...o&userid=35101
View this thread: http://www.excelforum.com/showthread...hreadid=548559



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select case and Last Cell Problem


Thanks for that Ron the only thing is there are some rows with data in
that I dont want to copy I only want to copy the lines across that have
a letter in them, some have a few words in


--
JamesBurrows
------------------------------------------------------------------------
JamesBurrows's Profile: http://www.excelforum.com/member.php...o&userid=35101
View this thread: http://www.excelforum.com/showthread...hreadid=548559

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Select case and Last Cell Problem

One letter or a A,B, C or ?

--
Regards Ron De Bruin
http://www.rondebruin.nl



"JamesBurrows" wrote in message
news:JamesBurrows.28xqjm_1149521103.2085@excelforu m-nospam.com...

Thanks for that Ron the only thing is there are some rows with data in
that I dont want to copy I only want to copy the lines across that have
a letter in them, some have a few words in


--
JamesBurrows
------------------------------------------------------------------------
JamesBurrows's Profile: http://www.excelforum.com/member.php...o&userid=35101
View this thread: http://www.excelforum.com/showthread...hreadid=548559



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
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Problem with Select Case construct? Chris Bromley[_2_] Excel Programming 1 April 12th 05 08:27 PM
Select Case on a range - problem cdb Excel Programming 4 February 11th 05 01:37 PM
Problem With Select Case Steve[_27_] Excel Programming 18 August 6th 03 09:28 PM


All times are GMT +1. The time now is 08:22 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"