Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have to create a macro which consists on importing a text file and give some format. However the same text file can change its size. The problem I have is that after creating a macro for example with 20 rows, and I add more rows to the text file, if I run the macro again it will not recognize more than the 20 rows used originally to create the macro. How can I customize the macro to take the amount of rows that are present in the text every time I have to run it. Hope somebody can help me with this. Thanks in advance, Karolina -- Karolina ------------------------------------------------------------------------ Karolina's Profile: http://www.excelforum.com/member.php...o&userid=31600 View this thread: http://www.excelforum.com/showthread...hreadid=512902 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Depends on what you're doing, but you could use:
dim lastrow as long with activesheet lastrow = .cells(.rows.count,"A").end(xlup).row ' Then you can use that in your code: .range("a1:x" & lastrow).somethinghere end with Karolina wrote: I have to create a macro which consists on importing a text file and give some format. However the same text file can change its size. The problem I have is that after creating a macro for example with 20 rows, and I add more rows to the text file, if I run the macro again it will not recognize more than the 20 rows used originally to create the macro. How can I customize the macro to take the amount of rows that are present in the text every time I have to run it. Hope somebody can help me with this. Thanks in advance, Karolina -- Karolina ------------------------------------------------------------------------ Karolina's Profile: http://www.excelforum.com/member.php...o&userid=31600 View this thread: http://www.excelforum.com/showthread...hreadid=512902 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i reformat text size in all comment boxs to a default size | Excel Worksheet Functions | |||
File Size With Macros Has Increased From Its Origina Size | Excel Discussion (Misc queries) | |||
Cell Limitations ? Formatting and Size when exporting to Tab based Text file? | Excel Worksheet Functions | |||
Macro or Function to make text size to suite text Length? | Excel Discussion (Misc queries) | |||
How to get the size of the excel file, a sheet size (in bytes)? | Excel Programming |