CiaoKarina
New Member
- Joined
- Oct 22, 2021
- Messages
- 12
- Office Version
- 365
- Platform
- MacOS
Hi! I'm sure this is something simple, its just that I am new to macros and don't completely understand everything I've found online!
I have a macro that is working great for me UNLESS I only have 1 or 2 rows of data.
First, let me explain my goal: In this example, Joe Johnson has 2 policies and I need his employee information on every line associated with him, so I need to "fill down" until the next value is found.
There are other things happening in the macro, but what I ultimately end up with is new B and C columns. B is concatenating the last 4 of A and the first 2 of what is now D.
Then I am using the "fill down" part of the macro to get a completed column C.
The error I get when there are only 1 or 2 rows is "AutoFill method of Range class failed". I can get around this by creating different macros for each but I'd rather understand what I'm doing wrong. There will never be a set number of rows. First time attaching mini-sheets so hopefully doing this correctly!
Thanks!
K
I have a macro that is working great for me UNLESS I only have 1 or 2 rows of data.
First, let me explain my goal: In this example, Joe Johnson has 2 policies and I need his employee information on every line associated with him, so I need to "fill down" until the next value is found.
There are other things happening in the macro, but what I ultimately end up with is new B and C columns. B is concatenating the last 4 of A and the first 2 of what is now D.
Then I am using the "fill down" part of the macro to get a completed column C.
The error I get when there are only 1 or 2 rows is "AutoFill method of Range class failed". I can get around this by creating different macros for each but I'd rather understand what I'm doing wrong. There will never be a set number of rows. First time attaching mini-sheets so hopefully doing this correctly!
Thanks!
K
SAMPLEFILE.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | PayorNumber | Payor Name | Policy Number | Type | Deduction Amount | Total Due | Amount Remitted | ||
2 | XXXXXX1234 | SMITH,ELIZABETH | 1234566 | GU | 105.92 | 105.92 | 105.92 | ||
3 | XXXXXX5678 | JONES,MICHAEL | 1234567 | GU | 110.48 | 110.48 | 110.48 | ||
4 | XXXXXX1111 | JOHNSON,JOE | 1234568 | GU | 131.18 | 131.18 | 131.18 | ||
5 | 1234569 | GU | 22.46 | 22.46 | 22.46 | ||||
6 | TOTAL | 153.64 | 153.64 | 153.64 | |||||
7 | XXXXXX2222 | ALVAREZ,MARIA | 876543 | Cancer | 24.9 | 24.9 | 24.9 | ||
8 | XXXXXX3333 | SIMPSON,JESSE | 8765432 | Cancer | 24.36 | 24.36 | 24.36 | ||
Allstate Bill |
SAMPLEFILE.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | PayorNumber | Payor Name | Policy Number | Type | Deduction Amount | Total Due | Amount Remitted | ||
2 | XXXXXX1234 | SMITH,ELIZABETH | 1234566 | GU | 105.92 | 105.92 | 105.92 | ||
3 | XXXXXX5678 | JONES,MICHAEL | 1234567 | GU | 110.48 | 110.48 | 110.48 | ||
4 | |||||||||
Allstate 2 people |
SAMPLEFILE.xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | PayorNumber | Payor Name | Policy Number | Type | Deduction Amount | Total Due | Amount Remitted | Reason | ||
2 | XXXXXX1234 | SMITH,ELIZABETH | 1234566 | GU | 105.92 | 105.92 | 105.92 | |||
3 | ||||||||||
Allstate 1 person |