Office & Productivity Software forum

General discussion

Excel Macro

by Shadow-28 / April 13, 2006 1:12 AM PDT


I have create a macro on a worksheet by importing two different text files one below the other.

The two file names never change nor does it format(Though the two files have different formats)...

i would like to start importing the second file immediately from the next row to the one in which the first file ends...

Since number of rows dynamically change based on amount of data in both files(More importantly the first one)...I am unable to write a one time macro...

In a nutshell, I would like the macro to recognise the Keyboard movements, to find end of first file,
rather than hardcoding the row numbers

Discussion is locked
You are posting a reply to: Excel Macro
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Excel Macro
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
2 ideas.
by R. Proffitt Forum moderator / April 13, 2006 3:00 AM PDT
In reply to: Excel Macro

1. If text, just concatenate the files so there is only one file to import. Hint: Batch file with ...


2. If more processing is required I used the old TXT2CSV programs years ago. Links:


Collapse -
Determining the end row of the current sheet
by richardp123 / April 13, 2006 10:09 AM PDT
In reply to: Excel Macro

Assuming column A in your first import is fully populated, one way to determine the next free row in the sheet is to use the following VBA macro function:

lastrow = (activesheet.cells(65535,1).end(xlup).row) + 1

Popular Forums
Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


Help, my PC with Windows 10 won't shut down properly

Since upgrading to Windows 10 my computer won't shut down properly. I use the menu button shutdown and the screen goes blank, but the system does not fully shut down. The only way to get it to shut down is to hold the physical power button down till it shuts down. Any suggestions?