M
Michael Dobony
I have the following absolute ranges in Excel 2010 VBA macro. I have
variables assigned with the column number, as listed below. I am having
difficulty replacing the column letters with a Cell(row,column) format with
the assigned variables. I've tried numerous variations using cells and
columns ranges, but nothign works. Other changes, such as
Range("JB3").Activate work when changed to Cells(3,USD_Gross).Activate, so
I know the variables have the correct values. The variables are dimensioned
as Integers.
I have about 20+pages of macros that need these changes. They're basically
taking raw data (formats and columns can move, causing serious issues with
the macros as is) and reformatting it and bringing in summaries. It worked
fine when it was built originally, but changed formats for the raw data
messed things up considerably. I need to make this adaptable to increased
columns.
Can anybody help me figure out this mess? I need to get the specific cell
and column references converted to use the variables. Thanks.
For Each rngA In Range("JB3:JB" & Range("JE60000").End(xlUp).Row)
If WorksheetFunction.Trim(Range("JB" &
ActiveCell.Row).Value) = 0 Or WorksheetFunction.Trim(Range("JC" &
ActiveCell.Row).Value) = 0 Or WorksheetFunction.Trim(Range("M" &
ActiveCell.Row).Value) = 0 Then
JB=USD_Gross
JC=USDNet
JE=ProdSrv
variables assigned with the column number, as listed below. I am having
difficulty replacing the column letters with a Cell(row,column) format with
the assigned variables. I've tried numerous variations using cells and
columns ranges, but nothign works. Other changes, such as
Range("JB3").Activate work when changed to Cells(3,USD_Gross).Activate, so
I know the variables have the correct values. The variables are dimensioned
as Integers.
I have about 20+pages of macros that need these changes. They're basically
taking raw data (formats and columns can move, causing serious issues with
the macros as is) and reformatting it and bringing in summaries. It worked
fine when it was built originally, but changed formats for the raw data
messed things up considerably. I need to make this adaptable to increased
columns.
Can anybody help me figure out this mess? I need to get the specific cell
and column references converted to use the variables. Thanks.
For Each rngA In Range("JB3:JB" & Range("JE60000").End(xlUp).Row)
If WorksheetFunction.Trim(Range("JB" &
ActiveCell.Row).Value) = 0 Or WorksheetFunction.Trim(Range("JC" &
ActiveCell.Row).Value) = 0 Or WorksheetFunction.Trim(Range("M" &
ActiveCell.Row).Value) = 0 Then
JB=USD_Gross
JC=USDNet
JE=ProdSrv