Hi.
This is probably very hard to follow, but I'll try my best because I am very desperate for help.
Counts = number of columns I need to copy.
BLANK = a variable that stores a certain integer such as 7,8,or 9.
Height = How long I want the range to be. (This length is in row direction.)
I am trying to find BLANK in a row, first. Then, I will copy a range of cells below the BLANK cell, and paste it onto another sheet. the range will have the length of height (in y direction).
I've been running the code below, and kept getting RunTimeError 1004:application defined object defined error".
Please Help!
* I know this is a very confusing description but I will GREATLY appreciate your help. * Below is only a part of a huge code, so It does not have "sub" or "dim".
My Code is --------------------------------------------------------------
Sheets(3).Select
ActiveSheet.Cells(7, 2 + Width).Select
m = 0
While m <= Counts
If Selection.Value = BLANK Then
Selection.Offset(1, 0).Select
x = ActiveCell.Row
y = ActiveCell.Column
Sheets(3).Range(Cells(8, y), Cells((7 + Height), y)).Copy
Sheets(1).Select
Cells(17, 4 + m).Select
ActiveSheet.Paste
m = m + 1
Sheets(3).Select
ActiveSheet.Cells(x, y).Select
Selection.Offset(-1, 1).Select
End If
If Selection.Value <> BLANK Then
x = ActiveCell.Row
y = ActiveCell.Column
y = y + 1
Sheets(3).Select
Sheets(3).Cells(x, y).Select
Else
m = m
End If
Wend
THANKS!
This is probably very hard to follow, but I'll try my best because I am very desperate for help.
Counts = number of columns I need to copy.
BLANK = a variable that stores a certain integer such as 7,8,or 9.
Height = How long I want the range to be. (This length is in row direction.)
I am trying to find BLANK in a row, first. Then, I will copy a range of cells below the BLANK cell, and paste it onto another sheet. the range will have the length of height (in y direction).
I've been running the code below, and kept getting RunTimeError 1004:application defined object defined error".
Please Help!
* I know this is a very confusing description but I will GREATLY appreciate your help. * Below is only a part of a huge code, so It does not have "sub" or "dim".
My Code is --------------------------------------------------------------
Sheets(3).Select
ActiveSheet.Cells(7, 2 + Width).Select
m = 0
While m <= Counts
If Selection.Value = BLANK Then
Selection.Offset(1, 0).Select
x = ActiveCell.Row
y = ActiveCell.Column
Sheets(3).Range(Cells(8, y), Cells((7 + Height), y)).Copy
Sheets(1).Select
Cells(17, 4 + m).Select
ActiveSheet.Paste
m = m + 1
Sheets(3).Select
ActiveSheet.Cells(x, y).Select
Selection.Offset(-1, 1).Select
End If
If Selection.Value <> BLANK Then
x = ActiveCell.Row
y = ActiveCell.Column
y = y + 1
Sheets(3).Select
Sheets(3).Cells(x, y).Select
Else
m = m
End If
Wend
THANKS!