+ Reply to Thread
Results 1 to 18 of 18

Can't get Active offset and how to move around the spreasheet

  1. #1
    Registered User
    Join Date
    12-29-2003
    Posts
    43

    Can't get Active offset and how to move around the spreasheet

    So I wrote this macro by recording part of it and reading up on some notes regarding active offset. So far so good.
    Now I am at C17 and I am trying to move over to A16. I know how to go left 2, but not up 2, enter the account number like 12345678 and copy it up from A16 to A1.
    Than I need to move to F and if the amount is not zero, enter "R" and if Zero enter "V" and stop at row 16. The row number can change each day.
    I have not had to write macros for a long time, I find it frustrating now. Need some help.
    Attached Files Attached Files
    Annelie

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Can't get Active offset and how to move around the spreasheet

    Where is the 'macro' hiding.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Can't get Active offset and how to move around the spreasheet

    Hi Annelie

    Are you sure that the uploaded file is the correct one...What are you actually wanting to achieve...
    Now I am at C17 and I am trying to move over to A16.
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Registered User
    Join Date
    12-29-2003
    Posts
    43

    Re: Can't get Active offset and how to move around the spreasheet

    My macro actually just takes out headers and footers from a report exported to excel.

    So offset(-1, -2) means: first position -1 is row up, 1 means row down, second position is the column -2 meaning go left 2?
    However, there is another problem, the number of rows will vary every day. There cannot be static rows. How do you establish the last row?

    I still have to fill column A, F, G. it is an issued check list for a bank.
    I attached another spreadsheet with what the finish product is supposed to look like. I cannot see it right now.

    After all is done, I need to copy and paste this to notepad which seems to be the only format that comes over as a clean text file.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Can't get Active offset and how to move around the spreasheet

    Why don't you upload a sample file with a before | after scenario and explain exactly what this daily process entails...

  6. #6
    Registered User
    Join Date
    12-29-2003
    Posts
    43

    Re: Can't get Active offset and how to move around the spreasheet

    I don't seem to be able to do that, I went to manage attachments and uploaded it, but I cannot get it to show.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,521

    Re: Can't get Active offset and how to move around the spreasheet

    Did you actually go:
    Go Advanced - Manage Attachments - Choose File - Upload - Close This Window?
    It never failed me this way.

  8. #8
    Registered User
    Join Date
    12-29-2003
    Posts
    43

    Re: Can't get Active offset and how to move around the spreasheet

    I have been doing this but I still do not see the file.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Can't get Active offset and how to move around the spreasheet

    Need to wait for file to upload and once it displays...then Close window submit reply...

  10. #10
    Registered User
    Join Date
    12-29-2003
    Posts
    43

    Re: Can't get Active offset and how to move around the spreasheet

    last try for upload. Mya be I have to start a new post
    Attached Files Attached Files

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Can't get Active offset and how to move around the spreasheet

    explain exactly what this daily process entails...

  12. #12
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,521

    Re: Can't get Active offset and how to move around the spreasheet

    OK, now that we have a workbook to look at, could you let us know what you want to achieve keeping in mind that we're looking at the attachment from your last post.

  13. #13
    Registered User
    Join Date
    12-29-2003
    Posts
    43

    Re: Can't get Active offset and how to move around the spreasheet

    The data exported into Excel is in column BCDE.
    I have to add the account number in Column A, Add R or V (V for Void if the amount is zero)in col. F, and the letter A in Column G.

    Than I have to combine all into text file (somebody helped me with that):
    =A1&","&TEXT(B1,"0.00")&","&C1&","&TEXT(D1,"ddmmyy")&","&E1&","&F1&G1
    copy down,copy and paste the result into notepad.

    Tried to save in Excel as various .txt files, but all resulted errors in the file. Copy and paste into notepad was the only thing that worked.

  14. #14
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Can't get Active offset and how to move around the spreasheet

    maybe:
    Please Login or Register  to view this content.
    Ben Van Johnson

  15. #15
    Registered User
    Join Date
    12-29-2003
    Posts
    43

    Re: Can't get Active offset and how to move around the spreasheet

    Can you change this line:
    Accn = Application.InputBox("Enter account number", "Fill accounts", , , , , , Type:=2)

    Input accounts =123456789 as sample. This number never changes.

  16. #16
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Can't get Active offset and how to move around the spreasheet

    In that case, just delete the inputbox line and change the one below it to
    Range("A1").FormulaR1C1 = "123456789"

  17. #17
    Registered User
    Join Date
    12-29-2003
    Posts
    43

    Re: Can't get Active offset and how to move around the spreasheet

    It is not entering the account number in col. A. Col F and G work.
    I cannot us cvs file, but I already have a routine I can use to create that later.
    Attached Files Attached Files

  18. #18
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Can't get Active offset and how to move around the spreasheet

    You need to delete the lines:
    Dim Accn As String
    and
    Range("A1").FormulaR1C1 = Accn

+ 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] Cannot paste formula into offset active cell
    By icyrius in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-09-2018, 11:52 AM
  2. copying cell values from an active row using the offset function
    By Maxwelll in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2018, 01:27 PM
  3. Offset formula references (only active sheet's)
    By Grho in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2018, 03:09 AM
  4. [SOLVED] Userform textbox to reference active cell with offset
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 6
    Last Post: 12-15-2013, 01:38 AM
  5. [SOLVED] Userform to add data to active cell offset
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 12-14-2013, 07:58 PM
  6. Running a different Active.Cell Offset.....
    By Kirtman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2012, 05:52 AM
  7. In a spreasheet, how do you move a column around?
    By Spin in forum Excel General
    Replies: 4
    Last Post: 06-28-2006, 05:55 PM

Tags for this Thread

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