Using Relative Excel Spreadsheet References in Vba macro

July 20, 2009 by vba excel
Filed under: Excel Spreadsheet, Excel Vba 
Sponsor

Excel Vba Using Relative Excel Spreadsheet References in Vba macro [Q]
I want to move the contents of excel spreadsheet cell (in an array) when I know its column and relative row number using excel vba macro. The requested cell (date & time format) is in Column D and its relative row # is in cell E5. I want to move the contents of this cell to cell B1. The following is a sample of the table:

Col D
7/16/2009 23:23:57
7/17/2009 4:10:07
7/17/2009 5:40:25
7/17/2009 20:58:30
7/17/2009 23:22:49
7/18/2009 3:00:51
7/18/2009 5:58:52

I’ve tried various approaches to specify the relative cell’s location so I
can move its contents but with no success. Help. Thanks for your assistance.

Excel Vba Using Relative Excel Spreadsheet References in Vba macro [A]
Do you mean you want to add one to whatever is in E5 excel spreadsheet cell? Is so…

Range(”B1″).Value = Cells(Range(”E5″).Value + 1, “D”).Value

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • E-mail this story to a friend!
  • Live
  • MisterWong
  • Propeller
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb
  • Print this article!

Rate This Tips:

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


Incoming excel search terms

vba relative reference,excel vba relative reference,relative reference vba,relative reference in vba,spreadsheet références,search in excel sheet using range vba,excel macro relative position,excel spreadsheet reference copy macro,excel vba relative cell reference,relative cell reference vba,excel macro relative reference,excel relative worksheet reference,excel vba copy formula to cell keeping the relative reference,excel vba formula relative reference,excel vba relative,excel vba spreadsheet name,macro excel move cell relative reference find,mss,relative excel,relative reference in excel vba,relative references in vba,relative value in excel,using relative positioning for macro in excel,vba excel relative reference,vba spreadsheet name,,add column in excel sheet using macro,cells vlaue vba excel relavite,copy 2 columns using relative reference in a macro,copy formulas without reference to other workbook macro,copy worksheet to new workbook relative referances,excel date functions cell references,excel macro add 1 to value,excel macro reference current spreadsheet,excel macro relative reference formula,excel reference relative another spreadsheet,excel relative,excel relative row macro,excel relative value,excel spreadsheet reference,excel spreadsheet references,excel spreadsheet using vba,excel vba references 2009,excel vba refrence cell based on its content,excel vba relative column,excel vba relative formula,excel vba relative row,macro excel cell reference,macro spreadsheet,relative in spread sheet



Related Excel Tips

Comments

2 Comments on Using Relative Excel Spreadsheet References in Vba macro

  1. Subbu on Wed, 2nd Sep 2009 6:24 am
  2. I want to identify a particular delivery date my sheet is as follows

    PO Supplier PO Value delivery 9/1/09 9/2/09 9/03/09 9/04/09
    400156 ABC 4500.00 X X X D
    500153 XYZ 5000.00 X D
    852215 RAK 8520.00 X X D

    Now when ever a delivery is made i have an entry d under the respective date. I want a formula that will identify the D(delivery) and show the delivery date as corresponding column date on the top. I have about 200 orders at any time of the year to track.

  3. pradnya on Fri, 11th Sep 2009 8:48 am
  4. i m copying one excel file from 1 location to other and making the changes through vba code to that file.
    but when i save that file using code only the all excel files gets crashed.
    and changes are are notreflecting to that file.

Have another excel answer or questions for this problem ?
Feel free to post it here..