+ Reply to Thread
Results 1 to 2 of 2

Macro shifting values to the right

  1. #1
    Registered User
    Join Date
    02-18-2015
    Location
    Nevada, USA
    MS-Off Ver
    2010
    Posts
    28

    Macro shifting values to the right

    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 5/21/03 by Peter Porto
    '

    '
    ChDir "C:\WINDOWS\Desktop"
    Workbooks.OpenText Filename:="C:\WINDOWS\Desktop\LAUS-ALMIS.txt", Origin:= _
    xlWindows, StartRow:=3, DataType:=xlDelimited, TextQualifier:= _
    xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
    Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 9), _
    Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
    Array(9, 1))
    Range("A1:G84").Select
    Selection.Copy
    Windows("Book1").Activate
    ActiveSheet.Paste
    Range("A1").Select
    Windows("LAUS-ALMIS.txt").Activate
    ActiveWindow.Close
    End Sub

    Above is the macro that I am using. the overall purpose of the macro is to import a text file but do so in a very, specific manner. What should be happening is that three columns (D, E, and F) should contain data after the import is done. Instead it is J and K. . In this case, B and C are prepopulated with stuff. If the import was working correctly, columns D, E, and F would contain corresponding values from the text file. By looking at the macro, can you discern why it is shifting my values 4 columns to the right?
    Last edited by twilcox1978; 03-06-2015 at 03:30 PM.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro shifting values to the right

    Please put your code in
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Shifting data based on values
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-03-2014, 06:24 PM
  2. [SOLVED] Copy and paste values shifting 1 row down each time
    By j.farr3ll in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2013, 03:46 AM
  3. Shifting x-values in chart
    By Abed Alnaif in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-29-2008, 04:40 AM
  4. Replies: 2
    Last Post: 06-02-2008, 10:05 AM
  5. shifting values
    By ChinaBoat in forum Excel General
    Replies: 2
    Last Post: 06-23-2005, 09:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1