LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Macro Help

Colb

To get the last row with data and delete (assuming that there will always be data in column A
Rows(Range("a65536").End(xlUp).Row).Selec
Selection.Delete Shift:=xlU

To cycle through column E (again it assumes that there will be data in every cell
Range("e1").selec
while not isempty(activecell
activecell.offset(0,1).value = ....
activecell.offset(1,0).selec
wen

To get the value of the error code, there are various ways to do it. One way is to have a lookup table somewhere in the workbook and then use worksheetfunction.vlookup to get the description and put in in the next column. This would replace the ... above. Or you could put in a vlookup formula into column F and just copy it down and let it calculate. This would chagne the line to be activecell.offset(0,1).formula = "=vlookup(.....)

Ton
----- colby s wrote: ----

I have a worksheet I import a text file into and then remove certai
columns and format the sheet. The problem I am having is that the la
row always has data in it I don't need. I need to know how to find th
last row with data and then delete it through VBA code. The secon
problem is I have a column (column E) with error codes in it and
want to be able to go through every cell in that column and for eac
error code put the error reason in column F next to that row. I wa
thinking of looping through the rows in column E but was not sure ho
to. Any help would be appreciated

 
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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 08:26 AM.

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"