Search : in
By :

Active row range from sheet1 to sheet2

nfc883, on Aug 7, 2008 5:18:05 pm BST 
 Report this message to moderators

Hello,
This may be one of those totally simple things, but I'm teaching myself vba and have been pounding on this problem for days.

In short, sheet2 has a series of graphs that pull data from sheet1 and this all works fine if I set the exact data ranges in my code. But I want to have the data range be columns I through N in the row that contains the active cell on sheet1. I think I have the right idea, but can't seem to make it work.

I have tried many different ways. For instance:

Setting the data series in the first chart using ActiveCell:

.SeriesCollection(1).Values = Worksheets("Sheet1").Range(Cells(ActiveCell.Row, 9), Cells(ActiveCell.Row, 16))

or setting variables:

Dim ar As String ' active row from sheet1
Dim rngData As Range ' Range of user data to be used from sheet1

ar = ActiveCell.Row
Set rngData = Worksheets("Sheet1).Range(Cells(ar, 9), Cells(ar, 16))


or this:

Dim RowNum As Integer ' Active row from sheet 1
Set RowNum = Worksheets("Sheet1").Cells(ActiveCell.Row)

I'm such a beginner! Any ideas?

Best answers for « active row range from sheet1 to sheet2 » in :
Excel – Comparing cell A1 to entire A column in Sheet 2 ShowExcel – Comparing cell A1 to entire A column in Sheet 2 Issue Solution Note Issue I have been trying to compare sheet1 A2 to sheet2 A2 through A500 and if it exists somewhere in sheet2's a col then copy that entire row to a new sheet....
Excel – Macro for copy & paste selected range ShowExcel – Macro for copy & paste selected range Issue Solution Note Issue I have a summary of data by month in one sheet and the raw data in another sheet. Instead of creating multiple worksheets for my raw data for each month, I want...
Activate Volume Control in the taskbar ShowActivate Volume Control in the taskbar It may happen that after some configurations on your computer system, the icon volume control on your task bar disappears. Below is an indication how to recover same. The first step is to go...
Download Active Partition Manager ShowActive@ Partition Manager helps you to manage storage devices and the partitions that they contain. You can create, remove, format and rename the partitions on your computer without shutting down the system. The carried out changes will take...
Download Active@ Boot Disk ShowWindows advises you to create a recovery CD in case your system should be damaged. But this option only recovers your desktop and the rest can always be damaged. Active@ Boot Disk is a program which allows you to create a CD/DVD/USB which can boot...